Skip to content

Workflow file for this run

on:
release:
types: [created]
jobs:
release:
name: release ${{ matrix.target }}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
target:
- x86_64-apple-darwin
- aarch64-apple-darwin
steps:
- name: Setup Fluent CI
uses: fluentci-io/setup-fluentci@v4
- 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 envhub --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 ../../../envhub_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.tar.gz envhub
shasum -a 256 ../../../envhub_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.tar.gz > ../../../envhub_${{ 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=envhub_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.$ext
fluentci run github_pipeline release_upload
done
env:
TAG: ${{ env.RELEASE_VERSION }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DAGGER_CLOUD_TOKEN: ${{ secrets.DAGGER_CLOUD_TOKEN }}