Skip to content

Commit

Permalink
Merge pull request #30 from multiversx/update_github_actions
Browse files Browse the repository at this point in the history
update release workflow
  • Loading branch information
alyn509 authored Jun 28, 2023
2 parents aa86319 + 647f56a commit 53b402e
Show file tree
Hide file tree
Showing 6 changed files with 687 additions and 72 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/on_pull_request_build_contracts.yml
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
80 changes: 8 additions & 72 deletions .github/workflows/release.yml
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
!**/wasm*/Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk
219 changes: 219 additions & 0 deletions esdt-system-sc-mock/wasm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 53b402e

Please sign in to comment.