Skip to content

Commit 6fefcff

Browse files
committed
ci: prerelease setup
1 parent 3bfc494 commit 6fefcff

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

.github/workflows/onPushToMain.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@ name: version, tag and github release
22

33
on:
44
push:
5-
branches: [main]
5+
branches:
6+
- main
7+
- prerelease/*
8+
tags-ignore:
9+
- '*'
610

711
jobs:
812
release:
913
uses: salesforcecli/github-workflows/.github/workflows/githubRelease.yml@main
1014
secrets: inherit
15+
with:
16+
prerelease: ${{ github.ref_name != 'main' }}
1117
docs:
1218
uses: salesforcecli/github-workflows/.github/workflows/publishTypedoc.yml@main
1319
secrets: inherit

.github/workflows/onRelease.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
name: publish
2+
13
# when a github release happens, publish an npm package,
24
on:
35
release:
4-
types: [released]
6+
types: [published]
57
# support manual release
68
workflow_dispatch:
79
inputs:
@@ -10,9 +12,21 @@ on:
1012
type: string
1113
required: true
1214
jobs:
15+
getDistTag:
16+
outputs:
17+
tag: ${{ steps.distTag.outputs.tag }}
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v3
21+
with:
22+
ref: ${{ github.event.release.tag_name || inputs.tag }}
23+
- uses: salesforcecli/github-workflows/.github/actions/getPreReleaseTag@main
24+
id: distTag
1325
npm:
1426
uses: salesforcecli/github-workflows/.github/workflows/npmPublish.yml@main
27+
needs: [getDistTag]
1528
with:
1629
ctc: false
30+
tag: ${{ needs.getDistTag.outputs.tag || 'latest' }}
1731
githubTag: ${{ github.event.release.tag_name || inputs.tag }}
1832
secrets: inherit

0 commit comments

Comments
 (0)