Skip to content

Commit dd13770

Browse files
authored
feat: Npm Pkg for app contract addresses (#141)
Npm Pkg for app contract addresses
1 parent ce47d94 commit dd13770

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

.github/workflows/publish-npm.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Publish to NPM
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout Repository
13+
uses: actions/checkout@v3
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: "16"
19+
registry-url: "https://registry.npmjs.org"
20+
21+
- name: Install Dependencies
22+
run: yarn install
23+
24+
- name: Determine NPM Tag zeta app contracts
25+
id: determine-npm-tag-zeta-app-contracts
26+
working-directory: packages/zeta-app-contracts
27+
run: |
28+
VERSION_TAG=${GITHUB_REF#refs/tags/v}
29+
if [[ $VERSION_TAG == *"-"* ]]; then
30+
echo ::set-output name=NPM_TAG::${VERSION_TAG#*-}
31+
else
32+
echo ::set-output name=NPM_TAG::latest
33+
fi
34+
env:
35+
GITHUB_REF: ${{ github.ref }}
36+
37+
- name: Publish to NPM zeta app contracts
38+
working-directory: packages/zeta-app-contracts
39+
run: yarn publish --new-version ${GITHUB_REF#refs/tags/v} --tag ${{ steps.determine-npm-tag.outputs.NPM_TAG }} --no-git-tag-version
40+
env:
41+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
42+
GITHUB_REF: ${{ github.ref }}
43+
44+
- name: Determine NPM Tag zevm app contracts
45+
id: determine-npm-tag-zevm-app-contracts
46+
working-directory: packages/zevm-app-contracts
47+
run: |
48+
VERSION_TAG=${GITHUB_REF#refs/tags/v}
49+
if [[ $VERSION_TAG == *"-"* ]]; then
50+
echo ::set-output name=NPM_TAG::${VERSION_TAG#*-}
51+
else
52+
echo ::set-output name=NPM_TAG::latest
53+
fi
54+
env:
55+
GITHUB_REF: ${{ github.ref }}
56+
57+
- name: Publish to NPM zevm app contracts
58+
working-directory: packages/zevm-app-contracts
59+
run: yarn publish --new-version ${GITHUB_REF#refs/tags/v} --tag ${{ steps.determine-npm-tag.outputs.NPM_TAG }} --no-git-tag-version
60+
env:
61+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
62+
GITHUB_REF: ${{ github.ref }}

0 commit comments

Comments
 (0)