-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e20712c
commit ed45096
Showing
2 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Release asset bot | ||
|
||
on: | ||
workflow_dispatch: | ||
release: | ||
types: [published] | ||
jobs: | ||
build: | ||
name: Build release asset | ||
continue-on-error: true | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: | ||
- ubuntu-latest | ||
- ubuntu-18.04 | ||
- ubuntu-22.04 | ||
- macos-latest | ||
- windows-latest | ||
runs-on: ${{matrix.platform}} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Install LLVM and Clang # required for bindgen to work, see https://github.com/rust-lang/rust-bindgen/issues/1797 | ||
uses: KyleMayes/install-llvm-action@v1 | ||
if: matrix.platform == 'windows-latest' | ||
with: | ||
version: "11.0" | ||
directory: ${{ runner.temp }}/llvm | ||
- name: Set LIBCLANG_PATH | ||
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV | ||
if: matrix.platform == 'windows-latest' | ||
- name: build for ${{ matrix.platform }} | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --release | ||
|
||
- name: build rooch release asset | ||
run: bash ./scripts/release.sh ${{ matrix.platform }} | ||
|
||
- name: upload artifact asset | ||
uses: actions/upload-artifact@v2 | ||
if: ${{ github.event_name != 'release'}} | ||
with: | ||
name: rooch-${{ matrix.platform }}.zip | ||
path: ./rooch-${{ matrix.platform }}.zip | ||
|
||
- name: upload rooch release asset | ||
if: ${{ github.event_name == 'release'}} | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ./rooch-${{ matrix.platform }}.zip | ||
asset_name: rooch-${{ matrix.platform }}.zip | ||
asset_content_type: application/zip |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
rm -rf rooch-artifacts/* | ||
mkdir -p rooch-artifacts/ | ||
cp -v target/release/rooch rooch-artifacts/ | ||
cp -v README.md rooch-artifacts/ | ||
if [ "$1" == "windows-latest" ]; then | ||
7z a -r rooch-$1.zip rooch-artifacts | ||
else | ||
zip -r rooch-$1.zip rooch-artifacts | ||
fi |