Skip to content

- fix: cargo edit dep #3

- fix: cargo edit dep

- fix: cargo edit dep #3

name: Release development
on:
push:
branches: [main,agallardol/publish-cargo-package]
defaults:
run:
working-directory: ./
jobs:
prebuild:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.package-version.outputs.version }}
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: get npm version
id: package-version
uses: Saionaro/[email protected]
publish-libraries:
needs: prebuild
runs-on: ubuntu-latest
environment: development
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node version
uses: actions/setup-node@v3
with:
node-version: 18
check-latest: false
registry-url: https://registry.npmjs.org
cache: 'npm'
cache-dependency-path: package-lock.json
- name: Cache cargo assets
id: cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: build-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install dependencies
run: |
npm cache verify
npm ci --no-audit --prefer-offline
- name: Setup cargo version from npm
run: |
cargo install cargo-edit --force
cargo set-version ${{ needs.prebuild.outputs.version }}-dev.${{github.run_number}}
- name: Run NX publish
run: npx nx run-many -t publish --skip-nx-cache --verbose
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}