Add dev branch to CI deploy target #36
Workflow file for this run
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
name: babylonchain/babylon-contract/deploy | |
on: | |
push: | |
branches: | |
- 'fix/ci-permissions' | |
tags: | |
- 'v*.*.*' | |
env: | |
CARGO_TERM_COLOR: always | |
WORKSPACE: "/home/runner/work/babylon-contract/babylon-contract" | |
jobs: | |
build_and_upload_contracts: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: read | |
pull-requests: read | |
contents: write | |
deployments: write | |
pages: write | |
repository-projects: write | |
statuses: write | |
steps: | |
- uses: actions/checkout@v4.1.0 | |
- name: Build optimised Wasm binaries | |
run: "./scripts/optimizer.sh" | |
- uses: actions/upload-artifact@v4.1.0 | |
with: | |
path: |- | |
artifacts/babylon_contract.wasm | |
artifacts/btc_staking.wasm | |
artifacts/btc_finality.wasm | |
artifacts/checksums.txt | |
- name: Show data | |
run: |- | |
ls -ld artifacts | |
ls -l artifacts | |
cat artifacts/checksums.txt | |
- name: Zip artefacts | |
run: |- | |
id | |
zip artifacts/babylon_contract.wasm.zip artifacts/babylon_contract.wasm | |
zip artifacts/btc_staking.wasm.zip artifacts/btc_staking.wasm | |
zip artifacts/btc_finality.wasm.zip artifacts/btc_finality.wasm | |
zip artifacts/op_finality_gadget.wasm.zip artifacts/op_finality_gadget.wasm | |
- name: Create a Release | |
id: create-release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
tag_name: ${{ github.ref_name }} | |
release_name: Release ${{ github.ref_name }} | |
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.zip | |
asset_name: babylon_contract.wasm.zip | |
asset_content_type: application/zip | |
- name: Upload btc_staking | |
id: upload-btc_staking | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ steps.create-release.outputs.upload_url }} | |
asset_path: ./artifacts/btc_staking.wasm.zip | |
asset_name: btc_staking.wasm.zip | |
asset_content_type: application/zip | |
- name: Upload btc_finality | |
id: upload-btc_finality | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ steps.create-release.outputs.upload_url }} | |
asset_path: ./artifacts/btc_finality.wasm.zip | |
asset_name: btc_finality.wasm.zip | |
asset_content_type: application/zip | |
- name: Upload op_finality_gadget | |
id: upload-op_finality_gadget | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ steps.create-release.outputs.upload_url }} | |
asset_path: ./artifacts/op_finality_gadget.wasm.zip | |
asset_name: op_finality_gadget.wasm.zip | |
asset_content_type: application/zip | |
- name: Upload checksums | |
id: upload-checksums | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ steps.create-release.outputs.upload_url }} | |
asset_path: ./artifacts/checksums.txt | |
asset_name: checksums.txt | |
asset_content_type: text/plain | |
- name: Build and run schema generator | |
run: |- | |
(cd ./contracts/babylon && cargo run --bin schema) | |
(cd ./contracts/btc-staking && cargo run --bin btc-staking-schema) | |
(cd ./contracts/btc-finality && cargo run --bin btc-finality-schema) | |
- name: Consolidate schemas | |
run: |- | |
mkdir -p ./schemas | |
cp -a ./contracts/*/schema/* ./schemas | |
- name: Show data | |
run: ls -l ./schemas | |
- name: Zip schemas | |
run: |- | |
zip -r ./schemas.zip 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.zip | |
asset_name: schemas.zip | |
asset_content_type: application/zip |