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 x86_64-apple-darwin | |
runs-on: macos-12 | |
strategy: | |
fail-fast: false | |
matrix: | |
target: | |
- x86_64-apple-darwin | |
- aarch64-apple-darwin | |
steps: | |
- name: Installing needed dependencies | |
run: brew install protobuf sccache | |
- name: Checking out sources | |
uses: actions/checkout@v1 | |
- name: Setup Fluent CI | |
uses: fluentci-io/setup-fluentci@v5 | |
with: | |
wasm: true | |
engine-version: 0.4.0 | |
pipeline: rust | |
args: | | |
target_add aarch64-apple-darwin | |
build --release --target ${{ matrix.target }} | |
env: | |
RUSTC_WRAPPER: /usr/local/bin/sccache | |
- 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 ../../../fluentci-engine_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.tar.gz fluentci-engine | |
shasum -a 256 ../../../fluentci-engine_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.tar.gz > ../../../fluentci-engine_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.tar.gz.sha256 | |
cd ../../../ && rm -rf target | |
- name: Upload assets to Cloudflare R2 | |
run: | | |
mkdir -p r2/fluentci-engine/${{ env.RELEASE_VERSION }} | |
cp fluentci-engine_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.tar.gz r2/fluentci-engine/${{ env.RELEASE_VERSION }} | |
cp fluentci-engine_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.tar.gz.sha256 r2/fluentci-engine/${{ env.RELEASE_VERSION }} | |
cd r2 && fluentci run --wasm r2-sync upload --endpoint-url https://$ACCOUNT_ID.r2.cloudflarestorage.com s3://assets | |
env: | |
TAG: ${{ env.RELEASE_VERSION }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.R2_AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_AWS_SECRET_ACCESS_KEY }} | |
ACCOUNT_ID: fe5b1e2ce9f94f4c0415ab94ce402012 | |
- name: Upload release assets | |
run: | | |
for ext in tar.gz tar.gz.sha256; do | |
export FILE=fluentci-engine_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.$ext | |
fluentci run --wasm github release_upload $TAG $FILE | |
done | |
env: | |
TAG: ${{ env.RELEASE_VERSION }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |