Skip to content

Try and enable CI release jobs #7

Try and enable CI release jobs

Try and enable CI release jobs #7

Workflow file for this run

name: babylonchain/babylon-contract/deploy
on:
push:
branches:
- '^v[0-9]+\.[0-9]+\.[0-9]+.*'
- 'fix/ci-github-actions-3'
env:
CARGO_TERM_COLOR: always
WORKSPACE: "/home/runner/work/babylon-contract/babylon-contract"
jobs:
build_and_upload_contracts:
defaults:
run:
working-directory: "$WORKSPACE"
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
path: "$WORKSPACE"
- name: Make temporary bin
run: mkdir -p /tmp/bin
- name: Install ghr
run: wget https://github.com/tcnksm/ghr/releases/download/v0.14.0/ghr_v0.14.0_linux_amd64.tar.gz -O - | tar -zxvf - -C /tmp/bin --wildcards --strip-components 1 */ghr
- name: Build optimised Wasm binaries
run: "./scripts/build-optimizer-ci.sh"
- uses: actions/[email protected]
with:
path: |-
artifacts/babylon_contract.wasm
artifacts/btc_staking.wasm
artifacts/checksums.txt
- name: Show data
run: |-
ls -l artifacts
cat artifacts/checksums.txt
- name: Publish artifacts on GitHub
run: |-
TAG="${{ github.ref }}"
TITLE="$TAG"
BODY="Attached there are some build artifacts generated at this tag. Those are for development purposes only! Please use crates.io to find the packages of this release."
/tmp/bin/ghr -t "$GITHUB_TOKEN" \
-u "$CIRCLE_PROJECT_USERNAME" -r "${{ github.repository }}" \
-c "${{ github.sha }}" \
-n "$TITLE" -b "$BODY" \
-replace \
"$TAG" ./artifacts/
build_and_upload_schemas:
defaults:
run:
working-directory: "$WORKSPACE"
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
path: "$WORKSPACE"
- name: Make temporary bin
run: mkdir -p /tmp/bin
- name: Install ghr
run: wget https://github.com/tcnksm/ghr/releases/download/v0.14.0/ghr_v0.14.0_linux_amd64.tar.gz -O - | tar -zxvf - -C /tmp/bin --wildcards --strip-components 1 */ghr
- name: Build and run schema generator
run: |-
(cd ./contracts/babylon && cargo run --bin schema)
(cd ./contracts/btc-staking && cargo run --bin btcstaking-schema)
- name: Consolidate schemas
run: |-
mkdir -p ./schemas
cp -a ./contracts/*/schema/* ./schemas
- name: Show data
run: ls -l ./schemas
- name: Publish schemas on GitHub
run: |-
TAG="${{ github.ref }}"
TITLE="$TAG"
BODY="Attached there are some schemas and build artifacts generated at this tag. Those are for development purposes only! Please use crates.io to find the packages of this release."
/tmp/bin/ghr -t "$GITHUB_TOKEN" \
-u "$CIRCLE_PROJECT_USERNAME" -r "${{ github.repository }}" \
-c "${{ github.sha }}" \
-n "$TITLE" -b "$BODY" \
-replace \
"$TAG" ./schemas/