Skip to content

Commit 96d8aa8

Browse files
committed
ci: use github actions
1 parent 5a2207f commit 96d8aa8

File tree

4 files changed

+67
-1
lines changed

4 files changed

+67
-1
lines changed

.github/workflows/npm-publish.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Publish to npm
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: latest
16+
registry-url: https://registry.npmjs.org/
17+
- run: npm ci
18+
- run: npm publish
19+
env:
20+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

.github/workflows/npm-test.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Run tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
17+
- uses: FedericoCarboni/setup-ffmpeg@v3
18+
- run: npm ci
19+
- run: npm test
20+
- uses: codecov/codecov-action@v4
21+
with:
22+
token: ${{ secrets.CODECOV_TOKEN }}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Release Please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/create-github-app-token@v1
17+
id: create-token
18+
with:
19+
app-id: ${{ vars.APP_ID }}
20+
private-key: ${{ secrets.PRIVATE_KEY }}
21+
- uses: googleapis/release-please-action@v4
22+
with:
23+
token: ${{ steps.create-token.outputs.token }}
24+
release-type: node

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"scripts": {
1818
"prepare": "tsc -p tsconfig.build.json",
1919
"fix": "eslint --fix . && prettier --write .",
20-
"test": "jest --coverage && tsc --noEmit && eslint . && prettier --check ."
20+
"test": "jest --coverage && tsc --noEmit && eslint ."
2121
},
2222
"files": [
2323
"lib"

0 commit comments

Comments
 (0)