add workflow for release + release v0.0.1 #5
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*" | |
pull_request: | |
branches: [master, main] | |
types: [synchronize, opened, reopened, ready_for_review] | |
jobs: | |
build-and-release: | |
name: Build and Release | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
# os: [ubuntu-latest, macos-latest, windows-latest] # Build for multiple OSes | |
os: [ubuntu-latest, macos-latest] # Build for multiple OSes | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust Toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Build Release | |
run: cargo build --release | |
# - name: Archive Release Binary (MacOS, Linux) | |
# if: runner.os != 'windows-latest' | |
# run: tar czvf ${{ runner.os }}-cpa.tar.gz -C ./target/release cpa | |
# - name: Archive Release Binary (Windows) | |
# if: runner.os == 'windows-latest' | |
# run: Compress-Archive -Path ./target/release/cpa.exe -DestinationPath windows-cpa.zip | |
# shell: pwsh | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
# if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
./target/release/cpa | |
# ${{ runner.os }}-cpa.tar.gz | |
# windows-cpa.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |