From d8feb22767746be44c29f58fe5c1ab5c3f067ad2 Mon Sep 17 00:00:00 2001 From: Young-Flash Date: Tue, 24 Sep 2024 17:45:05 +0800 Subject: [PATCH] ci: add bleeding-release.yml (#341) --- .github/workflows/bleeding-release.yml | 58 ++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/bleeding-release.yml diff --git a/.github/workflows/bleeding-release.yml b/.github/workflows/bleeding-release.yml new file mode 100644 index 00000000..73d7b9c3 --- /dev/null +++ b/.github/workflows/bleeding-release.yml @@ -0,0 +1,58 @@ +# moon: The build system and package manager for MoonBit. +# Copyright (C) 2024 International Digital Economy Academy +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +# For inquiries, you can contact us via e-mail at jichuruanjian@idea.edu.cn. + +name: Bleeding Release Mac + +on: + workflow_dispatch: + +jobs: + build: + strategy: + matrix: + os: [macos-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@1.80.0 + - name: Cargo cache + uses: actions/cache@v4 + with: + key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} + path: ~/.cargo/registry + - name: Build + run: cargo build --release + + - name: Bleeding Release (macos-latest) + if: ${{ matrix.os == 'macos-latest' }} + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} + run: | + rm -rf tmp-bins + mkdir tmp-bins + curl https://cli.moonbitlang.com/moon-ci/$(uname -s)-$(uname -m).tar.gz --output moonbit.tar.gz + tar xf moonbit.tar.gz --directory ./tmp-bins/ + cp -L ./target/release/moonrun ./tmp-bins/ + cp -L ./target/release/moon ./tmp-bins/ + pushd tmp-bins && shasum -a 256 -- * >../moonbit-darwin-aarch64.sha256 && popd + tar czf ./moonbit-darwin-aarch64.tar.gz --directory=./tmp-bins . + aws s3 cp ./moonbit-darwin-aarch64.tar.gz s3://cli.moonbitlang.com/binaries/bleeding/moonbit-darwin-aarch64.tar.gz + aws s3 cp ./moonbit-darwin-aarch64.sha256 s3://cli.moonbitlang.com/binaries/bleeding/moonbit-darwin-aarch64.sha256 + aws cloudfront create-invalidation --distribution-id E1KQYZEVEB0TAY --paths "/*"