forked from aragon/osx-plugin-template-hardhat
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add workflow for publishing artifacts npm package
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Publish Admin Plugin Artifact Package | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: 'Branch to publish from' | ||
required: true | ||
default: 'main' | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Step 1: Checkout the repository | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.inputs.branch }} | ||
|
||
# Step 2: Set up Node.js | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
registry-url: 'https://registry.npmjs.org/' | ||
|
||
# Step 3: Install dependencies | ||
- name: Install Dependencies | ||
run: | | ||
cd packages/artifact | ||
yarn install | ||
# Step 4: Generate ABIs | ||
- name: Generate ABIs | ||
run: | | ||
cd packages/artifact | ||
yarn generate | ||
# Step 5: Build the package | ||
- name: Build Package | ||
run: | | ||
cd packages/artifact | ||
yarn build | ||
# Step 6: Publish to NPM | ||
- name: Publish to NPM | ||
run: | | ||
cd packages/artifact | ||
npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |