1
- name : Npm Release
1
+ name : Release NPM
2
2
3
- on : # yamllint disable-line rule:truthy
3
+ on :
4
4
workflow_dispatch :
5
5
inputs :
6
6
release-version :
@@ -18,6 +18,10 @@ on: # yamllint disable-line rule:truthy
18
18
default : sps-frontend
19
19
options :
20
20
- 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"
21
25
jobs :
22
26
release :
23
27
name : release
@@ -28,23 +32,33 @@ jobs:
28
32
pull-requests : write # to be able to comment on released pull requests
29
33
id-token : write # to enable use of OIDC for npm provenance
30
34
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 }}
33
37
steps :
34
38
- 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
36
40
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
39
53
40
54
build-image :
41
55
runs-on : ubuntu-latest
42
56
needs : release
43
57
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
45
59
with :
46
- path : " ${{ inputs.app-path }}"
47
- image-name : " ${{ inputs.app-path }}"
60
+ path : ${{ inputs.app-path }}
61
+ image-name : ${{ inputs.app-path }}
48
62
artifact-name : ${{ needs.release.outputs.ARTIFACT_NAME }}
49
63
registry-password : ${{ secrets.GITHUB_TOKEN }}
50
64
registry-username : ${{ github.actor }}
56
70
runs-on : ubuntu-latest
57
71
steps :
58
72
- 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
61
74
with :
62
75
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