.github/workflows/release-for-mac.yml #20
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
on: | |
release: | |
types: [created] | |
jobs: | |
release: | |
name: release ${{ matrix.target }} | |
runs-on: macos-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- target: x86_64-apple-darwin | |
archive: tar.gz tar.xz | |
extensions: tar.gz tar.gz.sha256 | |
- target: aarch64-apple-darwin | |
archive: tar.gz tar.xz | |
extensions: tar.gz tar.gz.sha256 | |
steps: | |
- name: Setup Fluent CI | |
uses: fluentci-io/setup-fluentci@v1 | |
- name: Installing Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: ${{ matrix.target }} | |
override: true | |
- name: Checking out sources | |
uses: actions/checkout@v1 | |
- name: Running cargo build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
toolchain: stable | |
args: -p crosup --release --target ${{ matrix.target }} | |
- name: Install aarch64-apple-darwin toolchain | |
if: matrix.target == 'aarch64-apple-darwin' | |
run: rustup target add aarch64-apple-darwin | |
- name: Set env | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Packaging final binary | |
shell: bash | |
run: | | |
cd target/${{ matrix.target }}/release | |
tar czvf ../../../crosup_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.tar.gz crosup | |
shasum -a 256 ../../../crosup_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.tar.gz > ../../../crosup_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.tar.gz.sha256 | |
cd ../../../ && rm -rf target | |
- name: Upload release assets | |
run: | | |
for ext in tar.gz tar.gz.sha256; do | |
export FILE=crosup_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.$ext | |
fluentci run github_pipeline release_upload | |
done | |
env: | |
TAG: ${{ env.RELEASE_VERSION }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |