-
Notifications
You must be signed in to change notification settings - Fork 46
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 #632 from ElrondNetwork/actions-farm-v12
release action for legacy contract
- Loading branch information
Showing
1 changed file
with
81 additions
and
0 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,81 @@ | ||
name: Create release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
required: true | ||
description: Release tag | ||
title: | ||
required: true | ||
description: Release title | ||
image_tag: | ||
type: choice | ||
required: true | ||
description: Image elrondnetwork/build-contract-rust | ||
options: | ||
- v3.2.0 | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ env.GITHUB_REF_NAME }} | ||
fetch-depth: 0 | ||
repository: ${{ env.GITHUB_REPOSITORY }} | ||
|
||
- name: Download build script | ||
run: | | ||
wget https://raw.githubusercontent.com/ElrondNetwork/elrond-sdk-images-build-contract-rust/${{ github.event.inputs.image_tag }}/build_with_docker.py | ||
- name: Build contract | ||
run: | | ||
python3 ./build_with_docker.py --no-docker-tty --image=elrondnetwork/build-contract-rust:${{ github.event.inputs.image_tag }} --project=. --contract=farm --output=/home/runner/work/output-from-docker | ||
- name: Save artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: built-contracts | ||
path: | | ||
/home/runner/work/output-from-docker/**/*.wasm | ||
/home/runner/work/output-from-docker/**/*.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 "Built using Docker image: **elrondnetwork/build-contract-rust:${{ github.event.inputs.image_tag }}**." >> notes.txt | ||
echo "" >> notes.txt | ||
echo "## Codehash (blake2b):" >> notes.txt | ||
echo "" >> notes.txt | ||
for i in $(find ./assets -type f -name *.wasm); 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) |