-
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.
Add release script for ci[skip ci] (#369)
- Loading branch information
Showing
6 changed files
with
116 additions
and
7 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,50 @@ | ||
name: Release | ||
on: | ||
release: | ||
types: | ||
- published | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'release bifrost' | ||
required: true | ||
|
||
jobs: | ||
build-release: | ||
name: Build binary | ||
runs-on: self-hosted | ||
steps: | ||
- name: Set tag from input | ||
run: | | ||
echo "Tag: ${{ github.event.inputs.tag }}" | ||
echo "TAG=${{ github.event.inputs.tag }}" >> "$GITHUB_ENV" | ||
- name: Set Tag from release | ||
if: ${{ github.event.release.tag_name }} | ||
run: | | ||
echo "TAG=${{ github.event.release.tag_name }}" >> "$GITHUB_ENV" | ||
- name: Check to latest commit | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build bifrost | ||
run: | | ||
.maintain/publish-release.sh | ||
- name: Upload deploy | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: bifrost-artifact-${{ github.sha }} | ||
path: | | ||
./resources/bifrost-wasm.tar.bz2 | ||
./resources/bifrost-x86_64-linux-gnu.tar.bz2 | ||
- uses: 8398a7/action-slack@v3 | ||
if: failure() | ||
with: | ||
status: ${{ job.status }} | ||
fields: repo,author,eventName,workflow,ref,commit | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }} | ||
|
||
|
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,30 @@ | ||
#!/bin/bash | ||
|
||
set -xe | ||
|
||
RUSTC_VERSION="1.53.0" | ||
EXTRA_ARGS='--json' | ||
RUNTIME=bifrost | ||
BIN_PATH=$(dirname $(readlink -f $0)) | ||
WORK_PATH=${BIN_PATH}/../ | ||
|
||
###### build binary | ||
make build-bifrost-release | ||
|
||
cp target/release/bifrost ${WORK_PATH}/resources | ||
chmod +x ${WORK_PATH}/resources/bifrost | ||
tar cjSf ${WORK_PATH}/resources/bifrost-x86_64-linux-gnu.tar.bz2 ${WORK_PATH}/resources/bifrost | ||
|
||
|
||
###### build wasm | ||
docker run --rm -it \ | ||
-e PACKAGE=$RUNTIME-runtime \ | ||
-e VERBOSE=1 \ | ||
-e CARGO_TERM_COLOR=always \ | ||
-v ${TMPDIR}/cargo:/cargo-home \ | ||
-v ${WORK_PATH}:/build \ | ||
paritytech/srtool:${RUSTC_VERSION} build ${EXTRA_ARGS} | ||
|
||
cp ${WORK_PATH}/runtime/$RUNTIME/target/srtool/release/wbuild/$RUNTIME-runtime/${RUNTIME}_runtime.compact.wasm \ | ||
${WORK_PATH}/resources | ||
tar cjSf ${WORK_PATH}/resources/bifrost-wasm.tar.bz2 ${WORK_PATH}/resources/${RUNTIME}_runtime.compact.wasm |
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
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,4 @@ | ||
# Ignore everything in this directory | ||
* | ||
# Except this file | ||
!.gitignore |
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,5 @@ | ||
[toolchain] | ||
channel = "nightly-2021-09-12" | ||
components = ["cargo", "clippy", "rustc", "rustfmt", "rust-src"] | ||
profile = "minimal" | ||
targets = ["wasm32-unknown-unknown"] |
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