[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
This commit is contained in:
Dev Kalra 2023-03-29 19:38:18 +05:30 committed by GitHub
parent 1d9e48991b
commit 8da5965d5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,45 @@
name: Release Pyth Cosmwasm Contract
on:
push:
tags:
- pyth-cosmwasm-contract-v*
jobs:
release-contract:
name: Build and Release cosmwasm contract
runs-on: ubuntu-latest
defaults:
run:
working-directory: target_chains/cosmwasm
steps:
- uses: actions/checkout@v2
- name: Build
run: |
bash ./build.sh
zip -r artifacts.zip artifacts
- name: Set env
run: |
PREFIX="refs/tags/pyth-cosmwasm-contract-"
echo "VERSION=${GITHUB_REF:${#PREFIX}}" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
# Setting VERSION in set env step and hence it will be available
release_name: Pyth Cosmwasm Contract ${{ env.VERSION }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
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
asset_path: target_chains/cosmwasm/artifacts.zip
asset_name: artifacts.zip
asset_content_type: application/zip