Skip to content

Merge pull request #517 from nevermined-io/fix/provider-burn #123

Merge pull request #517 from nevermined-io/fix/provider-burn

Merge pull request #517 from nevermined-io/fix/provider-burn #123

Workflow file for this run

name: GitHub Release
on:
push:
tags:
- "v*.*.*"
permissions:
id-token: write
contents: read
jobs:
release:
name: "Tagged Release"
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.API_TOKEN_GITHUB }}
# Build process
- uses: actions/setup-node@v3
with:
node-version: '16.x'
cache: yarn
- name: Pre-install
run: |
yarn install --frozen-lockfile
git submodule init
git submodule update
- name: Compile and Lint
run: |
yarn clean
sh ./scripts/build-circuit.sh
yarn compile
# Add the artifacts to include in the release
- name: Set version to env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Package Artifacts
run: |
tar cvzf contracts-${{ env.RELEASE_VERSION }}.tar.gz contracts/
- name: Update CHANGELOG.md
id: changelog
run: |
yarn add --dev auto-changelog
npx auto-changelog
- name: Detect branch to commit changelog
id: branch-changelog
run: |
tagged_branches=$(git --no-pager branch -a --contains tags/${{ env.RELEASE_VERSION }} --no-column)
echo "$tagged_branches"
if echo "$tagged_branches" | grep -E '^[[:space:]]*main$' > /dev/null; then
commit_branch=main
elif echo "$tagged_branches" | grep -E '^[[:space:]]*main$' > /dev/null; then
commit_branch=main
elif echo "$tagged_branches" | grep -E '^[[:space:]]*develop$' > /dev/null; then
commit_branch=develop
else
commit_branch=$(echo "$tagged_branches" | tail -n1)
commit_branch=${commit_branch//[[:blank:]]/}
fi
commit_branch="${commit_branch//remotes\/origin\//}"
echo "COMMIT_BRANCH=${commit_branch}" >> $GITHUB_ENV
- name: Commit CHANGELOG.md
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Automated CHANGELOG.md update
commit_options: '--no-verify --signoff'
file_pattern: CHANGELOG.md
branch: ${{ env.COMMIT_BRANCH }}
- name: Publish Github relase
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
contracts-${{ env.RELEASE_VERSION }}.tar.gz
CHANGELOG.md
# Upload contracts abis to S3 bucket
# Install dependencies
- name: Install missing dependencies
run: |
sudo apt update
sudo apt install -y jq unzip zip git tar
# Install awscli
- name: install-aws-cli-action
uses: unfor19/[email protected]
# Impersonate AWS role
- name: Configure AWS credentials from Test account
uses: aws-actions/configure-aws-credentials@main
with:
role-to-assume: arn:aws:iam::059076247551:role/github-actions-s3-artifacts-nevermined-rocks
aws-region: us-east-1
# Upload abis to s3 artifact repository
- name: Upload abis and circuits to S3
working-directory: ./
run: |
bash -x ./scripts/upload_artifacts_s3.sh abis
bash -x ./scripts/upload_artifacts_s3.sh circuits