Skip to content

Commit

Permalink
build: use if to check if steps should execute (#24)
Browse files Browse the repository at this point in the history
* build: update version (#21)

Co-authored-by: justin <>

* build: make dev1 and dev2 workflow not triggerd when creating PR to main

* build: use if to check if steps should execute

Co-authored-by: justin <>
  • Loading branch information
JustinlinPerp authored Mar 15, 2022
1 parent ff5c2d6 commit b8ea713
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/dev1.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Publish NPM package for dev1
on:
push:
branches:
- op-kovan-dev1
branches:
- op-kovan-dev1
jobs:
publish-npm-package:
if: github.base_ref != 'main' && github.event_name != 'pull_request'
if: github.base_ref != 'main' && github.event_name != 'pull_request'
runs-on: ubuntu-latest
outputs:
pkg_version: ${{ steps.set-variables.outputs.pkg_version }}
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:

discord-notification-npm-package:
name: Discord Notification for publishing npm package
if: github.base_ref != 'main' && github.event_name != 'pull_request' && always()
if: always()
needs: [publish-npm-package]
runs-on: ubuntu-latest
steps:
Expand All @@ -73,7 +73,7 @@ jobs:
args: "**[@perp/v2-sdk: dev1]** @perp/v2-sdk version: **${{ needs.publish-npm-package.outputs.pkg_version }}** published successfully ✅"

- name: issue failure notificaiton
if: needs.publish-npm-package.result != 'success'
if: needs.publish-npm-package.result != 'success' && github.base_ref != 'main' && github.event_name != 'pull_request'
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_RELEASE_WEBHOOK }}
uses: Ilshidur/action-discord@master
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/dev2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ on:
push:
branches:
- op-kovan-dev2
pull_request:
branches-ignore:
- main
jobs:
publish-npm-package:
if: github.base_ref != 'main' && github.event_name != 'pull_request'
runs-on: ubuntu-latest
outputs:
pkg_version: ${{ steps.set-variables.outputs.pkg_version }}
Expand Down Expand Up @@ -74,7 +78,7 @@ jobs:
args: "**[@perp/v2-sdk: dev2]** @perp/v2-sdk version: **${{ needs.publish-npm-package.outputs.pkg_version }}** published successfully ✅"

- name: issue failure notificaiton
if: needs.publish-npm-package.result != 'success'
if: needs.publish-npm-package.result != 'success' && github.base_ref != 'main' && github.event_name != 'pull_request'
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_RELEASE_WEBHOOK }}
uses: Ilshidur/action-discord@master
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@perp/v2-sdk",
"version": "0.1.5-multicollateral",
"version": "0.1.5-alpha",
"license": "BSD 3-Clause",
"main": "dist/index.js",
"module": "dist/v2-sdk.esm.js",
Expand Down

0 comments on commit b8ea713

Please sign in to comment.