Skip to content

Commit 9250800

Browse files
Merge pull request #215 from salesforcecli/jschonning/newWorkflow
Jschonning/new workflow
2 parents c5473a5 + c0e3117 commit 9250800

File tree

5 files changed

+51
-58
lines changed

5 files changed

+51
-58
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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: failureNotifications
33
on:
44
workflow_run:
55
workflows:
6-
- version, tag and github release
76
- publish
7+
- create-github-release
88
types:
99
- completed
1010

.github/workflows/manualRelease.yml

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

.github/workflows/onPushToMain.yml

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

.github/workflows/onRelease.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,35 @@ 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:
1732
ctc: true
1833
sign: true
19-
tag: latest
34+
tag: ${{ needs.getDistTag.outputs.tag || 'latest' }}
2035
githubTag: ${{ github.event.release.tag_name || inputs.tag }}
2136
secrets: inherit

0 commit comments

Comments
 (0)