Skip to content

Commit a5ecb2f

Browse files
authored
Update npm-release.yml
1 parent 07fffd8 commit a5ecb2f

File tree

1 file changed

+26
-13
lines changed

1 file changed

+26
-13
lines changed

.github/workflows/npm-release.yml

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
name: Npm Release
1+
name: Release NPM
22

3-
on: # yamllint disable-line rule:truthy
3+
on:
44
workflow_dispatch:
55
inputs:
66
release-version:
@@ -18,6 +18,10 @@ on: # yamllint disable-line rule:truthy
1818
default: sps-frontend
1919
options:
2020
- sps-frontend # Add or modify frontend paths according to your project structure
21+
skip-deployment:
22+
default: true
23+
type: boolean
24+
description: "skip deployment to npm registry"
2125
jobs:
2226
release:
2327
name: release
@@ -28,23 +32,33 @@ jobs:
2832
pull-requests: write # to be able to comment on released pull requests
2933
id-token: write # to enable use of OIDC for npm provenance
3034
outputs:
31-
ARTIFACT_NAME: ${{ steps.npm_release.outputs.ARTIFACT_NAME }}
32-
ARTIFACT_VERSION: ${{steps.npm_release.outputs.ARTIFACT_VERSION}}
35+
ARTIFACT_NAME: ${{ steps.node.outputs.artifact-name }}
36+
ARTIFACT_VERSION: ${{ steps.npm_release.outputs.ARTIFACT_VERSION }}
3337
steps:
3438
- id: npm_release
35-
uses: it-at-m/.github/.github/actions/action-npm-release@main
39+
uses: it-at-m/lhm_actions/action-templates/actions/action-npm-release@a7d25dbabec2057695f865169fdc411d475d4667 # v1.0.19
3640
with:
37-
app-path: ${{inputs.app-path}}
38-
releaseVersion: ${{inputs.release-version}}
41+
app-path: ${{ inputs.app-path }}
42+
releaseVersion: ${{ inputs.release-version }}
43+
- id: node
44+
uses: it-at-m/lhm_actions/action-templates/actions/action-npm-build@a7d25dbabec2057695f865169fdc411d475d4667 # v1.0.19
45+
with:
46+
app-path: ${{ inputs.app-path }}
47+
- if: ${{ !inputs.skip-deployment }}
48+
shell: bash
49+
working-directory: ./${{ inputs.app-path }}
50+
run: npm --prefix ./${{ inputs.app-path }} publish --provenance --access public
51+
env:
52+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # Centralized token in it-at-m GitHub organization
3953

4054
build-image:
4155
runs-on: ubuntu-latest
4256
needs: release
4357
steps:
44-
- uses: it-at-m/.github/.github/actions/action-build-image@main
58+
- uses: it-at-m/lhm_actions/action-templates/actions/action-build-image@a7d25dbabec2057695f865169fdc411d475d4667 # v1.0.19
4559
with:
46-
path: "${{ inputs.app-path }}"
47-
image-name: "${{ inputs.app-path }}"
60+
path: ${{ inputs.app-path }}
61+
image-name: ${{ inputs.app-path }}
4862
artifact-name: ${{ needs.release.outputs.ARTIFACT_NAME }}
4963
registry-password: ${{ secrets.GITHUB_TOKEN }}
5064
registry-username: ${{ github.actor }}
@@ -56,8 +70,7 @@ jobs:
5670
runs-on: ubuntu-latest
5771
steps:
5872
- name: Create GitHub Release
59-
id: create_release
60-
uses: it-at-m/.github/.github/actions/action-create-github-release@main
73+
uses: it-at-m/lhm_actions/action-templates/actions/action-create-github-release@a7d25dbabec2057695f865169fdc411d475d4667 # v1.0.19
6174
with:
6275
artifact-name: ${{ needs.release.outputs.ARTIFACT_NAME }}
63-
tag-name: ${{ needs.release.outputs.ARTIFACT_VERSION }}
76+
tag-name: ${{ inputs.app-path }}-${{ needs.release.outputs.ARTIFACT_VERSION }}

0 commit comments

Comments
 (0)