Skip to content

Use the create release action #10

Use the create release action

Use the create release action #10

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:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- 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: Create a Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
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.
draft: false
prerelease: false
- name: Upload babylon_contract
id: upload_babylon_contract

Check failure on line 44 in .github/workflows/deploy.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/deploy.yml

Invalid workflow file

You have an error in your yaml syntax on line 44
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifacts/babylon_contract.wasm
asset_name: babylon_contract.wasm
build_and_upload_schemas:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- 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: |-
GITHUB_TOKEN="${{ github.token }}"
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/