Skip to content

Commit

Permalink
chore(workflow): update npm-publish.yml to use latest version of rele…
Browse files Browse the repository at this point in the history
…ase-please-action and actions/checkout@v4
  • Loading branch information
KRJOH3 committed Apr 17, 2024
1 parent bd6abd3 commit 87aad7c
Showing 1 changed file with 14 additions and 28 deletions.
42 changes: 14 additions & 28 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,27 @@ on:
push:
branches:
- main

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- name: Release Please
id: release-please
uses: GoogleCloudPlatform/release-please-action@v2
- uses: google-github-actions/release-please-action@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
package-name: "gqlprune"

- name: Create GitHub Release
if: steps.release-please.outputs.release-created == 'true'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.release-please.outputs.tag }}
release_name: Release ${{ steps.release-please.outputs.tag }}
body: ${{ steps.release-please.outputs.release-notes }}

publish-npm:
needs: release-please
if: needs.release-please.outputs.release-created == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
# The logic below handles the npm publication:
- uses: actions/checkout@v4
# these if statements ensure that a publication only occurs when
# a new release is created:
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: https://registry.npmjs.org/

node-version: 20
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs.release_created }}
- run: npm ci
if: ${{ steps.release.outputs.release_created }}
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{ steps.release.outputs.release_created }}

0 comments on commit 87aad7c

Please sign in to comment.