Skip to content

Commit b876afb

Browse files
committed
feat: added rust reader publish
1 parent 1313790 commit b876afb

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

.github/workflows/release.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
jobs:
99
publish-ts-reader:
10-
if: startsWith(github.ref, 'refs/tags/pkg-') || startsWith(github.ref, 'refs/tags/all-')
10+
if: startsWith(github.ref, 'refs/tags/pkg-')
1111
defaults:
1212
run:
1313
working-directory: "./reader/ts"
@@ -25,11 +25,29 @@ jobs:
2525
env:
2626
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
2727

28+
publish-rs-reader:
29+
runs-on: ubuntu-latest
30+
if: startsWith(github.ref, 'refs/tags/pkg-')
31+
defaults:
32+
run:
33+
working-directory: "./reader/rust"
34+
steps:
35+
- name: Checkout Code
36+
uses: actions/checkout@v4
37+
- name: Set version
38+
run: |
39+
VERSION=$(echo "${{ github.ref_name }}" | sed 's/^pkg-//')
40+
sed -i "s/version = \"0.0.0\"/version = \"$VERSION\"/" Cargo.toml
41+
- name: Cargo Login
42+
run: cargo login ${{secrets.CRATES_IO_PUBLISH}}
43+
- name: Publish crate
44+
run: cargo publish
45+
2846
publish-defintions:
2947
permissions:
3048
contents: write
3149
packages: read
32-
if: startsWith(github.ref, 'refs/tags/def-') || startsWith(github.ref, 'refs/tags/all-')
50+
if: startsWith(github.ref, 'refs/tags/def-')
3351
runs-on: ubuntu-latest
3452
steps:
3553
- name: Checkout Code
@@ -39,7 +57,6 @@ jobs:
3957
run: |
4058
zip -r definitions.zip definitions
4159
42-
4360
- name: Create GitHub Release
4461
uses: softprops/action-gh-release@v2
4562
with:

0 commit comments

Comments
 (0)