Skip to content

clean

clean #12

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
permissions:
contents: write
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: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create ${{ github.ref_name }} "./target/release/cpa" --generate-notes --title "Version ${{ github.ref_name }}"
# run: >-
# echo ${{ github.ref_name }}
# gh release create ${{ github.ref_name }} "./target/release/cpa" --generate-notes --title "Version ${{ github.ref_name }}"
# - 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