-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (43 loc) · 1.26 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: publish
on:
push:
branches:
- "master"
permissions:
contents: write
jobs:
publish:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
steps:
- name: init
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@gmail.com"
- uses: actions/checkout@v4
- name: install-node
uses: actions/setup-node@v1
with:
node-version: 20.x
- uses: wszgrcy/code-recycle-action@main
with:
path: ./script/sync-localize.ts
cwd: ./src
- run: npm install
- run: npm test
- name: build
run: npm run build
- id: publish
name: publish
uses: JS-DevTools/[email protected]
with:
token: ${{ secrets.NPM_PUBLISH_TOKEN }}
package: ./dist/package.json
- if: steps.publish.outputs.old-version != steps.publish.outputs.version
run: |
echo "[${{ steps.publish.outputs.type }}]Version changed: ${{ steps.publish.outputs.old-version }} => ${{ steps.publish.outputs.version }}"
git tag v${{steps.publish.outputs.version}}
git push origin v${{steps.publish.outputs.version}}