-
Notifications
You must be signed in to change notification settings - Fork 8
54 lines (51 loc) · 1.76 KB
/
onRelease.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: publish
on:
release:
# both release and prereleases
types: [published]
# support manual release in case something goes wrong and needs to be repeated or tested
workflow_dispatch:
inputs:
tag:
description: github tag that needs to publish
type: string
required: true
jobs:
getDistTag:
outputs:
tag: ${{ steps.distTag.outputs.tag }}
version: ${{ steps.distTag.outputs.version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name || inputs.tag }}
- uses: salesforcecli/github-workflows/.github/actions/getPreReleaseTag@main
id: distTag
- run: echo "[INFO] tag is=$INPUTS_TAG , version is=$INPUTS_VERSION"
env:
INPUTS_TAG: ${{ steps.distTag.outputs.tag }}
INPUTS_VERSION: ${{ steps.distTag.outputs.version }}
getMajorVersion:
needs: [getDistTag]
outputs:
major: ${{ steps.parsedVersion.outputs.major }}
runs-on: ubuntu-latest
steps:
- uses: salesforcecli/github-workflows/.github/actions/parse-semver@main
id: parsedVersion
with:
input_string: ${{ needs.getDistTag.outputs.version }}
- run: echo "[INFO] Major version is=$INPUTS_MAJOR_VERSION"
env:
INPUTS_MAJOR_VERSION: ${{ steps.parsedVersion.outputs.major }}
npm:
uses: salesforcecli/github-workflows/.github/workflows/npmPublish.yml@main
needs: [getDistTag, getMajorVersion]
with:
#ctc: true
sign: true
tag: ${{ needs.getDistTag.outputs.tag || (needs.getMajorVersion.outputs.major == '1') && 'latest' || 'next' }}
githubTag: ${{ github.event.release.tag_name || inputs.tag }}
nodeVersion: 20.18.0
secrets: inherit