Skip to content

Commit

Permalink
ci: add bleeding-release.yml (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
Young-Flash authored Sep 24, 2024
1 parent 496c4b7 commit d8feb22
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/bleeding-release.yml
Original file line number Diff line number Diff line change
@@ -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 <https://www.gnu.org/licenses/>.
#
# For inquiries, you can contact us via e-mail at [email protected].

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/[email protected]
- 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 "/*"

0 comments on commit d8feb22

Please sign in to comment.