Update upgrade check #448
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
name: Build and publish | |
on: | |
pull_request: | |
types: [closed] | |
branches: | |
- 'v*.*.*' | |
- develop | |
- beta | |
- release-candidate | |
- stable | |
push: | |
tags: | |
- 'custom-release-*' | |
env: | |
NODE_VERSION: 18 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: github.event_name != 'pull_request' || github.event.pull_request.merged == true | |
outputs: | |
version: ${{ steps.version.outputs.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install NODE JS | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: 'yarn' | |
- name: Install project | |
run: yarn install | |
- name: Calculate version | |
id: version | |
run: | | |
export BRANCH=${GITHUB_REF##*/} | |
echo "Branch $BRANCH" | |
export VERSION=$(bash ./scripts/calculate_version.sh) | |
echo "Version $VERSION" | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
( test $BRANCH = "stable" || test $BRANCH = "master" && export PRERELEASE=false ) || export PRERELEASE=true | |
echo "PRERELEASE=$PRERELEASE" >> $GITHUB_ENV | |
- name: Generate ABI | |
run: npx hardhat run scripts/generateAbi.ts | |
- name: Store artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: data | |
path: data | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ env.VERSION }} | |
prerelease: ${{ env.PRERELEASE }} | |
artifacts: "data/skale-manager-*-abi.json" | |
docker: | |
runs-on: ubuntu-latest | |
if: github.event_name != 'pull_request' || github.event.pull_request.merged == true | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build and publish container | |
env: | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
run: | | |
export BRANCH=${GITHUB_REF##*/} | |
echo "Branch $BRANCH" | |
export VERSION=$(bash ./scripts/calculate_version.sh) | |
echo "Version $VERSION" | |
bash ./scripts/build_and_publish.sh | |
abi: | |
runs-on: ubuntu-latest | |
needs: | |
build | |
env: | |
VERSION: ${{ needs.build.outputs.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: abi | |
- name: Load artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: data | |
- name: Commit ABI | |
uses: EndBug/add-and-commit@v9 | |
with: | |
default_author: github_actions | |
message: "Add ABI for version ${{ env.VERSION }}" | |
add: "*-abi.json" |