Skip to content

Commit 2b19105

Browse files
committed
Update onRelease.yml and delete old workflows
1 parent 8cfe903 commit 2b19105

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

.github/workflows/onRelease.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,33 @@ name: publish
22

33
on:
44
release:
5-
types: [released]
5+
# both release and prereleases
6+
types: [published]
67
# support manual release in case something goes wrong and needs to be repeated or tested
78
workflow_dispatch:
89
inputs:
910
tag:
10-
description: tag that needs to publish
11+
description: github tag that needs to publish
1112
type: string
1213
required: true
14+
1315
jobs:
16+
# parses the package.json version and detects prerelease tag (ex: beta from 4.4.4-beta.0)
17+
getDistTag:
18+
outputs:
19+
tag: ${{ steps.distTag.outputs.tag }}
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v3
23+
with:
24+
ref: ${{ github.event.release.tag_name || inputs.tag }}
25+
- uses: salesforcecli/github-workflows/.github/actions/getPreReleaseTag@main
26+
id: distTag
27+
1428
npm:
1529
uses: salesforcecli/github-workflows/.github/workflows/npmPublish.yml@main
30+
needs: [getDistTag]
1631
with:
17-
ctc: true
18-
sign: true
19-
tag: latest
32+
tag: ${{ needs.getDistTag.outputs.tag || 'latest' }}
2033
githubTag: ${{ github.event.release.tag_name || inputs.tag }}
2134
secrets: inherit

0 commit comments

Comments
 (0)