Skip to content

Commit

Permalink
build: simplify Rust release (#3392)
Browse files Browse the repository at this point in the history
Avoid duplicating actions between two workflows, prefer to only run
actual publishing steps if tag matches Rust releases
  • Loading branch information
luizirber authored Nov 11, 2024
1 parent e75f306 commit c736315
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 71 deletions.
25 changes: 24 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,13 @@ jobs:
working-directory: pkg
run: npm pack

- name: Publish to NPM
if: startsWith(github.ref, 'refs/tags/r')
working-directory: pkg
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- uses: actions/upload-artifact@v4
with:
path: 'pkg/sourmash*.tgz'
Expand Down Expand Up @@ -216,7 +223,7 @@ jobs:
args: test

publish:
name: Publish (dry-run)
name: Publish (on tags, dry-run otherwise)
runs-on: ubuntu-latest
steps:
- name: Checkout sources
Expand All @@ -243,6 +250,22 @@ jobs:
command: publish
args: --dry-run --manifest-path src/core/Cargo.toml

# Login to crates.io on tags
- name: login to crates.io
uses: actions-rs/cargo@v1
if: startsWith(github.ref, 'refs/tags/r')
with:
command: login
args: ${{ secrets.CRATES_IO_TOKEN }}

# Publish to crates.io on tags
- name: Publish to crates.io
if: startsWith(github.ref, 'refs/tags/r')
uses: actions-rs/cargo@v1
with:
command: publish
args: --manifest-path src/core/Cargo.toml

minimum_rust_version:
runs-on: ubuntu-latest
steps:
Expand Down
70 changes: 0 additions & 70 deletions .github/workflows/rust_publish.yml

This file was deleted.

0 comments on commit c736315

Please sign in to comment.