Skip to content

Commit

Permalink
CI updates to handle V2 release (#1006)
Browse files Browse the repository at this point in the history
* feat: handle v2 

* chore: node 20

* chore: keep default ci
  • Loading branch information
yohanelly95 authored Sep 10, 2024
1 parent 5848cac commit 734e552
Show file tree
Hide file tree
Showing 3 changed files with 643 additions and 1,948 deletions.
47 changes: 3 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ on:
push:
branches:
- main
- develop
- "release*"
pull_request:
types: [opened, synchronize]

jobs:

install_dependencies:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- uses: actions/setup-node@v3
Expand Down Expand Up @@ -108,45 +109,3 @@ jobs:
node-version: 16
sarif: results.sarif
fail-on: high

# WIP can safely be ignored
# gasCompare:
# runs-on: ubuntu-latest
# needs: install_dependencies
# steps:
# - uses: bissolli/gh-action-persist-workspace@v1
# with:
# action: retrieve
# - name: Run GasCompare
# run: |
# if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
# BRANCH_NAME=$GITHUB_HEAD_REF
# else
# BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g')
# fi
# echo "Current branch is $BRANCH_NAME"
# if [ "$BRANCH_NAME" == "master" ]; then
# echo "This is the master branch. Exiting..."
# exit 0
# fi
# CI=true npm run test
# mv ./gasReporterOutput.json /tmp/gasReporterOutput_Current.json
# git checkout master
# npm install
# CI=true npm run test
# mv ./gasReporterOutput.json /tmp/gasReporterOutput_Master.json

# - uses: bissolli/gh-action-persist-workspace@v1
# with:
# action: persist

# - name: Checkout
# uses: actions/checkout@v3

# - uses: bissolli/gh-action-persist-workspace@v1
# with:
# action: retrieve

# - name: Run GasCompare
# run: |
# npm run gasCompare /tmp/gasReporterOutput_Current.json /tmp/gasReporterOutput_Master.json
43 changes: 26 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
name: Release
name: Release Package

on:
push:
branches:
- "next"
tags:
- v*
jobs:
build:
publish-npm-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- uses: actions/setup-node@v1
with:
node-version: "16.x"
- run: yarn cp-ci-env
- run: yarn install
- run: yarn run hardhat export-abi
- run: yarn semantic-release
env:
GITHUB_TOKEN: ${{ secrets.RAZORNETWORKBOT }}
NPM_TOKEN: ${{ secrets.RAZORDEPLOYER }}
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: actions/setup-node@v3
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
- run: yarn cp-ci-env
- run: |
PKG_VERSION=$(node -p "require('./package.json').version")
TAG_VERSION=${GITHUB_REF#refs/tags/v}
if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then
echo "Package version ($PKG_VERSION) does not match tag version ($TAG_VERSION)"
exit 1
fi
- run: yarn install
- run: yarn run hardhat export-abi
- run: npm publish
env:
GITHUB_TOKEN: ${{ secrets.RAZORNETWORKBOT }}
NPM_TOKEN: ${{ secrets.RAZORDEPLOYER }}
Loading

0 comments on commit 734e552

Please sign in to comment.