Skip to content

Commit 79fdc5d

Browse files
authored
chore: update publish workflow (#70)
1 parent aa5c279 commit 79fdc5d

File tree

1 file changed

+16
-68
lines changed

1 file changed

+16
-68
lines changed

.github/workflows/publish.yaml

Lines changed: 16 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,19 @@
1-
name: Publish
2-
on:
3-
release:
4-
types: [released]
5-
workflow_dispatch:
1+
name: Publish package
62

7-
jobs:
8-
bump:
9-
runs-on: ubuntu-latest
10-
steps:
11-
- name: Checkout
12-
uses: actions/checkout@v3
13-
- name: Setup Node
14-
uses: actions/setup-node@v2
15-
with:
16-
node-version: '18.x'
17-
registry-url: 'https://registry.npmjs.org'
18-
- name: Update npm version
19-
run: npm version ${GITHUB_REF_NAME#v} --no-git-tag-version
20-
- name: Install stable toolchain
21-
uses: actions-rs/toolchain@v1
22-
with:
23-
profile: minimal
24-
toolchain: stable
25-
override: true
26-
- name: Install cargo bump
27-
run: cargo install cargo-bump
28-
- name: Update cargo version
29-
run: cargo bump ${GITHUB_REF_NAME#v}
30-
- uses: stefanzweifel/git-auto-commit-action@v4
31-
with:
32-
commit_message: 'chore: bump version'
33-
branch: main
3+
on:
4+
push:
5+
tags: ['*']
346

35-
publish_npm:
36-
runs-on: ubuntu-latest
37-
needs: bump
38-
steps:
39-
- name: Checkout
40-
uses: actions/checkout@v3
41-
with:
42-
ref: main
43-
- name: Setup Node
44-
uses: actions/setup-node@v2
45-
with:
46-
node-version: '18.x'
47-
registry-url: 'https://registry.npmjs.org'
48-
- name: Install dependencies and build 🔧
49-
run: npm ci && npm run build
50-
- name: Publish package on NPM 📦
51-
run: npm publish
52-
env:
53-
NODE_AUTH_TOKEN: ${{ secrets.NPM_GBPROD_GITCOMMIT }}
7+
concurrency:
8+
group: ${{github.workflow}}-${{github.ref}}
9+
cancel-in-progress: true
5410

55-
publish_crates:
56-
runs-on: ubuntu-latest
57-
needs: bump
58-
steps:
59-
- name: Checkout
60-
uses: actions/checkout@v3
61-
with:
62-
ref: main
63-
- name: Install stable toolchain
64-
uses: actions-rs/toolchain@v1
65-
with:
66-
profile: minimal
67-
toolchain: stable
68-
override: true
69-
- run: cargo publish --token ${CRATES_TOKEN}
70-
env:
71-
CRATES_TOKEN: ${{ secrets.CRATES_GBPROD_GITCOMMIT }}
11+
jobs:
12+
npm:
13+
uses: tree-sitter/workflows/.github/workflows/package-npm.yml@main
14+
secrets:
15+
NODE_AUTH_TOKEN: ${{secrets.NPM_GBPROD_GITCOMMIT}}
16+
crates:
17+
uses: tree-sitter/workflows/.github/workflows/package-crates.yml@main
18+
secrets:
19+
CARGO_REGISTRY_TOKEN: ${{secrets.CRATES_GBPROD_GITCOMMIT}}

0 commit comments

Comments
 (0)