This repository has been archived by the owner on Jan 12, 2025. It is now read-only.
ci: fix release workflow by using softprops/action-gh-release #2
Workflow file for this run
This file contains 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: Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
permissions: | |
contents: write | |
packages: write | |
jobs: | |
build-and-release: | |
name: Build and Release | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Build Release Binary | |
run: cargo build --release | |
- name: Create Release Archive | |
run: | | |
cd target/release | |
tar -czf dutis-macos.tar.gz dutis | |
shasum -a 256 dutis-macos.tar.gz > dutis-macos.tar.gz.sha256 | |
cd ../.. | |
mv target/release/dutis-macos.tar.gz . | |
mv target/release/dutis-macos.tar.gz.sha256 . | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
dutis-macos.tar.gz | |
dutis-macos.tar.gz.sha256 | |
draft: false | |
prerelease: false | |
generate_release_notes: true | |
publish-crate: | |
name: Publish to crates.io | |
needs: build-and-release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Publish to crates.io | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
run: cargo publish |