Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Publish
on:
release:
types: [created]

jobs:
publish:
name: Publish to crates.io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it might not do want we intend. IIUC, actions/checkout@master means that this will use the master branch version actions/checkout, not that it will checkout measureme's master branch. We probably want something like actions/checkout@v4, right? Ideally, we'd checkout the tag that was created for the release that triggered this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, we'd checkout the tag that was created for the release that triggered this.

OK, that seems to be the default behavior:
https://stackoverflow.com/questions/71663711/how-to-get-branch-name-which-triggered-a-github-action-workflow

- name: Install Rust (rustup)
run: rustup update stable && rustup default stable
- name: Publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish -p measureme