Skip to content

add workflow for release + release v0.0.1 #7

add workflow for release + release v0.0.1

add workflow for release + release v0.0.1 #7

Workflow file for this run

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
os: [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
env:
GITHUB_TOKEN:
${{ secrets.GITHUB_TOKEN }}
# ${{ runner.os }}-cpa.tar.gz
# windows-cpa.zip