Skip to content

Commit dcc3886

Browse files
author
Mauro Lacy
committed
Add deploy / release workflow
1 parent c0744bd commit dcc3886

File tree

1 file changed

+89
-0
lines changed

1 file changed

+89
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: babylonlabs/op-finality-gadget/deploy
2+
on:
3+
push:
4+
tags:
5+
- 'v*.*.*'
6+
env:
7+
CARGO_TERM_COLOR: always
8+
WORKSPACE: "/home/runner/work/op-finality-gadget"
9+
jobs:
10+
build_and_upload_contracts:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
packages: read
14+
pull-requests: read
15+
contents: write
16+
deployments: write
17+
pages: write
18+
repository-projects: write
19+
statuses: write
20+
steps:
21+
- uses: actions/[email protected]
22+
- name: Build optimised Wasm binaries
23+
run: "./scripts/optimizer.sh"
24+
- uses: actions/[email protected]
25+
with:
26+
path: |-
27+
artifacts/op_finality_gadget.wasm
28+
artifacts/checksums.txt
29+
- name: Show data
30+
run: |-
31+
ls -l artifacts
32+
cat artifacts/checksums.txt
33+
- name: Zip artifacts
34+
run: |-
35+
zip ./op_finality_gadget.wasm.zip artifacts/op_finality_gadget.wasm
36+
- name: Create a Release
37+
id: create-release
38+
uses: actions/create-release@v1
39+
env:
40+
GITHUB_TOKEN: ${{ github.token }}
41+
with:
42+
tag_name: ${{ github.ref_name }}
43+
release_name: Release ${{ github.ref_name }}
44+
body: |
45+
Attached there are some build artifacts generated at this tag.
46+
draft: false
47+
prerelease: false
48+
- name: Upload op_finality_gadget
49+
id: upload-op_finality_gadget
50+
uses: actions/upload-release-asset@v1
51+
env:
52+
GITHUB_TOKEN: ${{ github.token }}
53+
with:
54+
upload_url: ${{ steps.create-release.outputs.upload_url }}
55+
asset_path: ./op_finality_gadget.wasm.zip
56+
asset_name: op_finality_gadget.wasm.zip
57+
asset_content_type: application/zip
58+
- name: Upload checksums
59+
id: upload-checksums
60+
uses: actions/upload-release-asset@v1
61+
env:
62+
GITHUB_TOKEN: ${{ github.token }}
63+
with:
64+
upload_url: ${{ steps.create-release.outputs.upload_url }}
65+
asset_path: ./artifacts/checksums.txt
66+
asset_name: checksums.txt
67+
asset_content_type: text/plain
68+
- name: Build and run schema generator
69+
run: |-
70+
(cd ./contracts/op-finality-gadget && cargo run --bin schema)
71+
- name: Consolidate schemas
72+
run: |-
73+
mkdir -p ./schemas
74+
cp -a ./contracts/*/schema/* ./schemas
75+
- name: Show data
76+
run: ls -l ./schemas
77+
- name: Zip schemas
78+
run: |-
79+
zip -r ./schemas.zip schemas/
80+
- name: Upload schemas
81+
id: upload-schemas
82+
uses: actions/upload-release-asset@v1
83+
env:
84+
GITHUB_TOKEN: ${{ github.token }}
85+
with:
86+
upload_url: ${{ steps.create-release.outputs.upload_url }}
87+
asset_path: ./schemas.zip
88+
asset_name: schemas.zip
89+
asset_content_type: application/zip

0 commit comments

Comments
 (0)