-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from multiversx/update_github_actions
update release workflow
- Loading branch information
Showing
6 changed files
with
687 additions
and
72 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: On pull request, build contracts | ||
|
||
on: | ||
pull_request: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build: | ||
uses: multiversx/mx-sc-actions/.github/workflows/[email protected] | ||
with: | ||
image_tag: v5.1.0 |
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,80 +1,16 @@ | ||
name: Create release | ||
name: On release, build contracts | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
required: true | ||
description: Release tag | ||
title: | ||
required: true | ||
description: Release title | ||
release: | ||
types: [published] | ||
|
||
permissions: | ||
contents: write | ||
|
||
env: | ||
# https://github.com/actions/runner/issues/863 ($HOME is overridden for containers) | ||
ELROND_HOME: /home/elrond | ||
REPO_PATH: /home/elrond/sc-nft-collection-minter | ||
REPO_URL: https://github.com/ElrondNetwork/sc-nft-collection-minter.git | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
# See: https://docs.github.com/en/actions/using-jobs/running-jobs-in-a-container | ||
container: | ||
image: elrondnetwork/elrond-sdk-erdpy-rust:frozen-003 | ||
steps: | ||
# We don't use actions/checkout, since we want to control the location of the repository, | ||
# in order to achieve deterministic builds. | ||
- name: Check out code | ||
run: | | ||
echo "Cloning ref: $GITHUB_REF_NAME" | ||
cd $ELROND_HOME && git clone $REPO_URL --branch=$GITHUB_REF_NAME --depth=1 | ||
- name: Build WASM files | ||
run: | | ||
# Setting $HOME is required by erdpy. | ||
export HOME=$ELROND_HOME | ||
cd $REPO_PATH && bash ./build-wasm.sh | ||
- name: Save artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: built-contracts | ||
path: | | ||
${{ env.REPO_PATH }}/**/output/*.wasm | ||
${{ env.REPO_PATH }}/**/output/*.abi.json | ||
if-no-files-found: error | ||
|
||
release: | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: "0" | ||
|
||
- name: Download all workflow artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
path: assets | ||
|
||
- name: Create release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
echo "## Checksums (blake2b):" >> notes.txt | ||
echo "" >> notes.txt | ||
for i in $(find ./assets -type f); do | ||
filename=$(basename ${i}) | ||
checksum=($(b2sum -l 256 ${i})) | ||
echo " - **${filename}**: \`${checksum}\`" >> notes.txt | ||
done | ||
gh release create ${{ github.event.inputs.tag }} --target=$GITHUB_SHA --prerelease --title="${{ github.event.inputs.title }}" --generate-notes --notes-file=notes.txt | ||
sleep 10 | ||
gh release upload ${{ github.event.inputs.tag }} $(find ./assets -type f) | ||
uses: multiversx/mx-sc-actions/.github/workflows/[email protected] | ||
with: | ||
image_tag: v5.1.0 | ||
attach_to_existing_release: true | ||
skip_preliminary_checks: true |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.