-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try and enable CI release jobs (#48)
- Loading branch information
Showing
1 changed file
with
83 additions
and
58 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 |
---|---|---|
@@ -1,70 +1,93 @@ | ||
name: babylonchain/babylon-contract/deploy-WIP | ||
name: babylonchain/babylon-contract/deploy | ||
on: | ||
push: | ||
branches: [ "disabled" ] | ||
pull_request: | ||
branches: [ "disabled" ] | ||
branches: | ||
- '^v[0-9]+\.[0-9]+\.[0-9]+.*' | ||
env: | ||
AWS_ACCESS_KEY_ID: xxxxYKF5 | ||
AWS_REGION: xxxxst-1 | ||
AWS_SECRET_ACCESS_KEY: xxxxmvcn | ||
DEPLOY_KEY_NAME: xxxxc068 | ||
GITHUB_TOKEN: xxxxFyIu | ||
S3_BUCKET_PREFIX: xxxxract | ||
CARGO_TERM_COLOR: always | ||
WORKSPACE: "/home/runner/work/babylon-contract/babylon-contract" | ||
jobs: | ||
build_and_upload_contracts: | ||
defaults: | ||
run: | ||
working-directory: "/__w/babylon-contract/babylon-contract" | ||
runs-on: ubuntu-latest | ||
container: | ||
image: rust:1.78.0 | ||
permissions: | ||
packages: read | ||
pull-requests: read | ||
contents: write | ||
deployments: write | ||
pages: write | ||
repository-projects: write | ||
statuses: write | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
path: "/__w/babylon-contract/babylon-contract" | ||
- 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: |- | ||
/__w/babylon-contract/babylon-contract/artifacts/babylon_contract.wasm | ||
/__w/babylon-contract/babylon-contract/artifacts/btc_staking.wasm | ||
/__w/babylon-contract/babylon-contract/artifacts/checksums.txt | ||
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 | ||
- name: Zip artefacts | ||
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: "/__w/babylon-contract/babylon-contract" | ||
runs-on: ubuntu-latest | ||
container: | ||
image: rust:1.78.0 | ||
steps: | ||
- uses: actions/[email protected] | ||
zip artifacts/babylon_contract.wasm.zip artifacts/babylon_contract.wasm | ||
zip artifacts/btc_staking.wasm.zip artifacts/btc_staking.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: | ||
path: "/__w/babylon-contract/babylon-contract" | ||
- 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 | ||
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 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) | ||
|
@@ -75,14 +98,16 @@ jobs: | |
cp -a ./contracts/*/schema/* ./schemas | ||
- name: Show data | ||
run: ls -l ./schemas | ||
- name: Publish schemas on GitHub | ||
- name: Zip schemas | ||
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/ | ||
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 |