Skip to content

Commit 547884a

Browse files
Merge pull request #315 from snehaljha-sf/pipeline_fix_check
fix: remove readme oclif from doc
2 parents dde7a29 + 3102c35 commit 547884a

File tree

2 files changed

+86
-13
lines changed

2 files changed

+86
-13
lines changed

.github/workflows/create-github-release.yml

Lines changed: 83 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,96 @@ on:
66
- main
77
- prerelease/**
88
tags-ignore:
9-
- "*"
9+
- '*'
1010
workflow_dispatch:
1111
inputs:
1212
prerelease:
1313
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."
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+
skip-on-empty:
16+
type: boolean
17+
default: true
18+
description: 'Should release be skipped if there are no semantic commits?'
19+
generate-readme:
20+
type: boolean
21+
default: true
22+
description: 'Generate oclif readme'
23+
readme-multi:
24+
type: boolean
25+
description: 'Create a different markdown page for each topic.'
26+
default: false
1527

1628
jobs:
1729
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' }}
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Get Github user info
33+
id: github-user-info
34+
uses: salesforcecli/github-workflows/.github/actions/getGithubUserInfo@main
35+
with:
36+
SVC_CLI_BOT_GITHUB_TOKEN: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
37+
38+
- uses: actions/checkout@v4
39+
with:
40+
token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
41+
42+
- uses: salesforcecli/github-workflows/.github/actions/getPreReleaseTag@main
43+
id: distTag
44+
45+
- name: Validate prerelease
46+
if: github.ref_name == 'main' && inputs.prerelease
47+
uses: actions/github-script@v7
48+
with:
49+
script: |
50+
core.setFailed('Do not create a prerelease on "main". You can create a prerelease on a branch and when it is merged it will create a non-prerelease Release. For example: 1.0.1-beta.2 will release as 1.0.1 when merged into main.')
51+
52+
- name: Determine prerelease name
53+
id: prereleaseTag
54+
# Only run this step if the ref is not main
55+
# This will allow us to merge a prerelease PR into main and have it release as a normal release
56+
if: github.ref_name != 'main'
57+
run: |
58+
if [ -n "$INPUTS_PRERELEASE" ]; then
59+
echo "[INFO] Prerelease input passed in, using: $INPUTS_PRERELEASE"
60+
echo "tag=$INPUTS_PRERELEASE" >> "$GITHUB_OUTPUT"
61+
elif [ -n "$STEPS_DISTTAG_TAG" ]; then
62+
echo "[INFO] Prerelease tag found in package.json, using: $STEPS_DISTTAG_TAG"
63+
echo "tag=$STEPS_DISTTAG_TAG" >> "$GITHUB_OUTPUT"
64+
elif [[ "$GITHUB_REF_NAME" =~ ^prerelease/.* ]]; then
65+
echo "[INFO] Prerelease branch found but no prerelease tag, using default: dev"
66+
echo "tag=dev" >> "$GITHUB_OUTPUT"
67+
fi
68+
env:
69+
INPUTS_PRERELEASE: ${{ inputs.prerelease }}
70+
STEPS_DISTTAG_TAG: ${{ steps.distTag.outputs.tag }}
71+
72+
- name: Conventional Changelog Action
73+
id: changelog
74+
uses: TriPSs/conventional-changelog-action@3a392e9aa44a72686b0fc13259a90d287dd0877c
75+
with:
76+
git-user-name: ${{ steps.github-user-info.outputs.username }}
77+
git-user-email: ${{ steps.github-user-info.outputs.email }}
78+
github-token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
79+
tag-prefix: ''
80+
# Setting 'release-count' to 0 will keep ALL releases in the change log file (no pruning)
81+
release-count: '0'
82+
skip-on-empty: ${{ inputs.skip-on-empty }}
83+
pre-release: ${{ steps.prereleaseTag.outputs.tag != '' && 'true' || 'false' }}
84+
pre-release-identifier: ${{ steps.prereleaseTag.outputs.tag }}
85+
# ternary-ish: https://github.com/actions/runner/issues/409#issuecomment-752775072
86+
output-file: ${{ steps.prereleaseTag.outputs.tag != '' && 'false' || 'CHANGELOG.md' }} # If prerelease, do not write the changelog file
87+
88+
- name: Create Github Release
89+
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5
90+
if: ${{ steps.changelog.outputs.skipped == 'false' }}
91+
with:
92+
name: ${{ steps.changelog.outputs.tag }}
93+
tag: ${{ steps.changelog.outputs.tag }}
94+
commit: ${{ github.ref_name }}
95+
body: ${{ steps.changelog.outputs.clean_changelog }}
96+
prerelease: ${{ steps.prereleaseTag.outputs.tag != '' && 'true' || 'false' }}
97+
token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
98+
skipIfReleaseExists: true
2699
# docs:
27100
# # Most repos won't use this
28101
# # Depends on the 'release' job to avoid git collisions, not for any functionality reason

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,18 +96,18 @@
9696
},
9797
"repository": "salesforcecli/plugin-omnistudio-migration-tool",
9898
"scripts": {
99-
"build": "sf-build",
99+
"build": "sf-build && yarn copy-assets",
100100
"clean": "sf-clean",
101101
"clean-all": "sf-clean all",
102102
"clean:lib": "shx rm -rf lib && shx rm -rf coverage && shx rm -rf .nyc_output && shx rm -f oclif.manifest.json",
103-
"compile": "sf-compile",
103+
"compile": "sf-compile && yarn copy-assets",
104104
"copy-assets": "shx cp -r src/templates lib/ && shx cp -r src/styles lib/ && shx cp -r src/javascripts lib/",
105105
"docs": "sf-docs",
106106
"format": "sf-format",
107107
"lint": "sf-lint",
108108
"postpack": "shx rm -f oclif.manifest.json",
109109
"posttest": "yarn lint && yarn test:deprecation-policy && yarn test:command-reference",
110-
"prepack": "sf-prepack",
110+
"prepack": "sf-prepack && yarn copy-assets",
111111
"prepare": "sf-install",
112112
"pretest": "sf-compile-test",
113113
"test": "sf-test",

0 commit comments

Comments
 (0)