Skip to content

Commit

Permalink
ci(workflows): [publish] use node version file
Browse files Browse the repository at this point in the history
  • Loading branch information
unicornware committed Jan 8, 2023
1 parent d5b0e5f commit 38018a8
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,13 @@ on:
description: release tag
required: true
env:
ARTIFACT:
ARTIFACT: |
${{ github.event.inputs.artifact || github.event.release.assets[0].browser_download_url }}
NODE_VERSION: 16
SCOPE: ${{ format('@{0}', github.repository_owner) }}
TAG: ${{ github.event.inputs.tag || github.event.release.tag_name }}
jobs:
metadata:
runs-on: ubuntu-latest
env:
TAG: ${{ github.event.inputs.tag || github.event.release.tag_name }}
outputs:
dist-tag: ${{ steps.dist-tag.outputs.flag }}
version: ${{ steps.version.outputs.result }}
Expand Down Expand Up @@ -66,12 +64,17 @@ jobs:
${{ format('{0}/{1}/pkgs/npm/{2}', github.server_url, github.repository,
github.event.repository.name) }}
steps:
- id: checkout
name: Checkout ${{ env.TAG }}
uses: actions/[email protected]
with:
ref: ${{ format('refs/tags/{0}', env.TAG) }}
- id: npmrc
name: Setup .npmrc file
uses: actions/[email protected]
with:
always-auth: true
node-version: ${{ env.NODE_VERSION }}
node-version-file: .nvmrc
registry-url: https://npm.pkg.github.com
scope: ${{ env.SCOPE }}
- id: publish
Expand All @@ -88,12 +91,17 @@ jobs:
${{ format('https://npmjs.com/package/@{0}/v/{1}', github.repository,
needs.metadata.outputs.version) }}
steps:
- id: checkout
name: Checkout ${{ env.TAG }}
uses: actions/[email protected]
with:
ref: ${{ format('refs/tags/{0}', env.TAG) }}
- id: npmrc
name: Setup .npmrc file
uses: actions/[email protected]
with:
always-auth: true
node-version: ${{ env.NODE_VERSION }}
node-version-file: .nvmrc
registry-url: https://registry.npmjs.org
scope: ${{ env.SCOPE }}
- id: publish
Expand Down

0 comments on commit 38018a8

Please sign in to comment.