Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
39 changes: 21 additions & 18 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Release and Publish

on: [push]

permissions:
id-token: write
contents: write
packages: write

env:
BRANCH_TAG: "${{ github.ref_name == 'main' && 'latest' || github.ref_name }}"
BRANCH: ${{ github.ref_name }}
Expand All @@ -11,10 +16,10 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 18
node-version: 24
- name: Install dependencies
run: npm ci
- name: Run lint
Expand All @@ -30,22 +35,22 @@ jobs:
- name: Generate token
if: ${{ github.ref_name == 'main'}}
id: generate_token
uses: tibdex/github-app-token@v1
uses: tibdex/github-app-token@v2.1.0
with:
app_id: ${{ vars.FUNDABOT_APP_ID }}
private_key: ${{ secrets.FUNDABOT_PRIVATE_KEY }}

- uses: actions/setup-node@v3
- uses: actions/setup-node@v7
with:
node-version: 18
node-version: 24

- uses: actions/checkout@v3
- uses: actions/checkout@v7
with:
token: ${{ github.ref_name == 'main' && steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}

- name: Version bump
id: version
uses: phips28/gh-action-bump-version@v9.1.0
uses: phips28/gh-action-bump-version@v12.0.0
with:
major-wording: ${{ env.BRANCH == 'main' && '[bump major]' || '[bump major --force]' }}
minor-wording: ${{ env.BRANCH == 'main' && '[bump minor]' || '[bump minor --force]' }}
Expand All @@ -72,22 +77,20 @@ jobs:
git config user.name "fundabot"
git commit -a -m "CI: bumps @fundwave/fetch-queue to $VERSION" -m "[skip ci]"

- name: Publish package to gitlab
env:
GITLAB_TOKEN: ${{secrets.GITLAB_TOKEN}}
- name: Build package
run: npm run build

Comment thread
Isha-Sharma marked this conversation as resolved.
- name: Publish package to github
run: |
echo @fundwave:registry=https://gitlab.com/api/v4/projects/24877554/packages/npm/ > ~/.npmrc
echo //gitlab.com/api/v4/projects/24877554/packages/npm/:_authToken=$GITLAB_TOKEN >> ~/.npmrc
echo "@fundwave:registry=https://npm.pkg.github.com" >> ~/.npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc
npm publish --tag $BRANCH_TAG

- name: Publish package to npm
if: ${{ github.ref_name == 'main'}}
# if: ${{ github.ref_name == 'main'}}
run: |
echo //registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN} > ~/.npmrc
echo registry=https://registry.npmjs.org/ >> ~/.npmrc
echo "@fundwave:registry=https://registry.npmjs.org/" >> ~/.npmrc
npm publish --tag $BRANCH_TAG --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPMJS_TOKEN}}

- name: Push changes
uses: ad-m/github-push-action@master
Expand Down
Loading