Merge pull request #35 from code0-tech/34-version-arg #12
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish YML | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
publish-ts-reader: | |
if: startsWith(github.ref, 'refs/tags/pkg-') | |
defaults: | |
run: | |
working-directory: "./reader/ts" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '22.x' | |
registry-url: 'https://registry.npmjs.org' | |
- run: npm version from-git --git-tag-version=false | |
- run: npm ci | |
- run: npm run build | |
- run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} | |
publish-rs-reader: | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/pkg-') | |
defaults: | |
run: | |
working-directory: "./reader/rust" | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Set version | |
run: | | |
VERSION=$(echo "${{ github.ref_name }}" | sed 's/^pkg-//') | |
sed -i "s/version = \"0.0.0\"/version = \"$VERSION\"/" Cargo.toml | |
- name: Cargo Login | |
run: cargo login ${{secrets.CRATES_IO_PUBLISH}} | |
- name: Publish crate | |
run: cargo publish --allow-dirty | |
publish-defintions: | |
permissions: | |
contents: write | |
packages: read | |
if: startsWith(github.ref, 'refs/tags/def-') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Archive definitions folder | |
run: | | |
zip -r definitions.zip definitions | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ github.ref_name }} | |
name: Release ${{ github.ref_name }} | |
files: | | |
definitions.zip | |
generate_release_notes: true | |
make_latest: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_TOKEN }} | |
publish-cli: | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/cli-') | |
defaults: | |
run: | |
working-directory: "./cli" | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Set version | |
run: | | |
VERSION=$(echo "${{ github.ref_name }}" | sed 's/^cli-//') | |
sed -i "s/version = \"0.0.0\"/version = \"$VERSION\"/" Cargo.toml | |
- name: Cargo Login | |
run: cargo login ${{secrets.CRATES_IO_PUBLISH}} | |
- name: Publish crate | |
run: cargo publish --allow-dirty |