Skip to content

Commit 4c679f5

Browse files
authored
chore: add gha-prelease workflow [no ci] (#129)
1 parent a70883a commit 4c679f5

File tree

5 files changed

+37
-60
lines changed

5 files changed

+37
-60
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: create-github-release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- prerelease/**
8+
tags-ignore:
9+
- "*"
10+
workflow_dispatch:
11+
inputs:
12+
prerelease:
13+
type: string
14+
description: "Name to use for the prerelease: beta, dev, etc. NOTE: If this is already set in the package.json, it does not need to be passed in here."
15+
16+
jobs:
17+
release:
18+
uses: salesforcecli/github-workflows/.github/workflows/create-github-release.yml@main
19+
secrets: inherit
20+
with:
21+
prerelease: ${{ inputs.prerelease }}
22+
# If this is a push event, we want to skip the release if there are no semantic commits
23+
# However, if this is a manual release (workflow_dispatch), then we want to disable skip-on-empty
24+
# This helps recover from forgetting to add semantic commits ('fix:', 'feat:', etc.)
25+
skip-on-empty: ${{ github.event_name == 'push' }}
26+
# docs:
27+
# # Most repos won't use this
28+
# # Depends on the 'release' job to avoid git collisions, not for any functionality reason
29+
# needs: release
30+
# secrets: inherit
31+
# if: ${{ github.ref_name == 'main' }}
32+
# uses: salesforcecli/github-workflows/.github/workflows/publishTypedoc.yml@main

.github/workflows/failureNotifications.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
name: failureNotifications
2-
32
on:
43
workflow_run:
54
workflows:
65
- version, tag and github release
76
- publish
7+
- create-github-release
88
types:
99
- completed
10-
1110
jobs:
1211
failure-notify:
1312
runs-on: ubuntu-latest

.github/workflows/manualRelease.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/onPushToMain.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/onRelease.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
name: publish
2-
32
on:
43
release:
4+
# both release and prereleases
55
types: [published]
6+
# support manual release in case something goes wrong and needs to be repeated or tested
67
workflow_dispatch:
78
inputs:
89
tag:
9-
description: tag that needs to publish
10+
description: github tag that needs to publish
1011
type: string
1112
required: true
12-
1313
jobs:
14-
# parses the package.json version and detects prerelease tag (ex: beta from 4.4.4-beta.0)
1514
getDistTag:
1615
outputs:
1716
tag: ${{ steps.distTag.outputs.tag }}
@@ -22,7 +21,6 @@ jobs:
2221
ref: ${{ github.event.release.tag_name || inputs.tag }}
2322
- uses: salesforcecli/github-workflows/.github/actions/getPreReleaseTag@main
2423
id: distTag
25-
2624
npm:
2725
uses: salesforcecli/github-workflows/.github/workflows/npmPublish.yml@main
2826
needs: [getDistTag]
@@ -31,4 +29,5 @@ jobs:
3129
sign: true
3230
tag: ${{ needs.getDistTag.outputs.tag || 'latest' }}
3331
githubTag: ${{ github.event.release.tag_name || inputs.tag }}
32+
3433
secrets: inherit

0 commit comments

Comments
 (0)