mirror of
https://github.com/vexahub/tusc.git
synced 2026-08-07 00:00:04 +02:00
ci: update with auth action (#3)
This commit is contained in:
@@ -16,27 +16,24 @@ jobs:
|
||||
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Parse version from tag
|
||||
- name: Check version matches tag
|
||||
run: |
|
||||
TAG="${{ github.event.release.tag_name }}"
|
||||
VERSION="${TAG#v}"
|
||||
echo "TAG_VERSION=$VERSION" >> $GITHUB_ENV
|
||||
|
||||
- name: Check version matches Cargo.toml
|
||||
run: |
|
||||
CARGO_VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')
|
||||
if [ "$TAG_VERSION" != "$CARGO_VERSION" ]; then
|
||||
echo "Tag v$TAG_VERSION does not match Cargo.toml version $CARGO_VERSION"
|
||||
if [ "$VERSION" != "$CARGO_VERSION" ]; then
|
||||
echo "Tag v$VERSION does not match Cargo.toml version $CARGO_VERSION"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Run tests
|
||||
run: cargo test
|
||||
|
||||
- name: Dry run publish
|
||||
run: cargo publish --dry-run
|
||||
- name: Authenticate with crates.io
|
||||
id: auth
|
||||
uses: rust-lang/crates-io-auth-action@v1
|
||||
|
||||
- name: Publish to crates.io
|
||||
run: cargo publish
|
||||
env:
|
||||
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
|
||||
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
|
||||
|
||||
Reference in New Issue
Block a user