Skip to content

Add permissions

Add permissions #13

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'
permissions:
pull-requests: read
statuses: write
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.
draft: false
prerelease: false
- name: Upload babylon_contract
id: upload-babylon_contract
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: 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: Upload schemas
id: upload-schemas
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ./schemas
asset_name: schemas