Skip to content
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

ci: fix release workflow by using softprops/action-gh-release

ci: fix release workflow by using softprops/action-gh-release #2

Workflow file for this run

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