Skip to content

Commit 8da5965

Browse files
author
Dev Kalra
authored
[cosmwasm] Release Contract (#726)
* build contract * uploading artifacts * test * test * different version for upload artifact * update artifacts path * add release code * test * update artifact path * test * update release names * remove ls * rename tag * rename
1 parent 1d9e489 commit 8da5965

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Release Pyth Cosmwasm Contract
2+
3+
on:
4+
push:
5+
tags:
6+
- pyth-cosmwasm-contract-v*
7+
8+
jobs:
9+
release-contract:
10+
name: Build and Release cosmwasm contract
11+
runs-on: ubuntu-latest
12+
defaults:
13+
run:
14+
working-directory: target_chains/cosmwasm
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Build
18+
run: |
19+
bash ./build.sh
20+
zip -r artifacts.zip artifacts
21+
- name: Set env
22+
run: |
23+
PREFIX="refs/tags/pyth-cosmwasm-contract-"
24+
echo "VERSION=${GITHUB_REF:${#PREFIX}}" >> $GITHUB_ENV
25+
- name: Create Release
26+
id: create_release
27+
uses: actions/create-release@v1
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
with:
31+
tag_name: ${{ github.ref_name }}
32+
# Setting VERSION in set env step and hence it will be available
33+
release_name: Pyth Cosmwasm Contract ${{ env.VERSION }}
34+
draft: false
35+
prerelease: false
36+
- name: Upload Release Asset
37+
id: upload-release-asset
38+
uses: actions/upload-release-asset@v1
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
with:
42+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
43+
asset_path: target_chains/cosmwasm/artifacts.zip
44+
asset_name: artifacts.zip
45+
asset_content_type: application/zip

0 commit comments

Comments
 (0)