Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Release & Publish Package to NPM

on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main
Expand All @@ -16,6 +19,7 @@ permissions:
jobs:
release:
runs-on: ubuntu-latest
environment: npm
steps:
- name: Get CI Bot Token
uses: tibdex/github-app-token@v2
Expand All @@ -28,27 +32,23 @@ jobs:
uses: actions/checkout@v4
with:
token: ${{ steps.ci_bot_token.outputs.token }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"
- name: Upgrade npm for OIDC trusted publishing
run: npm install -g npm@latest
- name: Configure OIDC auth
run: |
sed -i '/_authToken/d' "$NPM_CONFIG_USERCONFIG"
unset NODE_AUTH_TOKEN
- name: Install the dependencies
run: npm ci

- name: Initialize Git User
run: |
git config --global user.email "github-actions[bot]@genlayer.com"
git config --global user.name "github-actions[bot]"

- uses: actions/setup-node@v4
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"

- run: npm install -g npm@latest

- run: npm ci

- name: Release
run: |
sed -i '/_authToken/d' "$NPM_CONFIG_USERCONFIG"
unset NODE_AUTH_TOKEN
if [ "${{ github.ref_name }}" = "staging" ]; then
npm run release-beta
else
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"bin": {
"genlayer": "./dist/index.js"
},
"files": ["dist", "scripts", "templates", ".env.example", "README.md", "LICENSE"],
"scripts": {
"test": "vitest",
"test:watch": "vitest --watch",
Expand Down
Loading