-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
- Loading branch information
1 parent
2abaf4c
commit d1e4261
Showing
10 changed files
with
170 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ groupby | |
hmarr | ||
iife | ||
infile | ||
kaisugi | ||
keyid | ||
ksort | ||
larsgw | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
# Release Branch Workflow | ||
# | ||
# Execute version bump and changelog operations on release branch creation or workflow dispatch. | ||
# | ||
# References: | ||
# | ||
# - https://docs.github.com/actions/learn-github-actions/contexts | ||
# - https://docs.github.com/actions/learn-github-actions/expressions | ||
# - https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#create | ||
# - https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch | ||
# - https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions | ||
# - https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#create | ||
# - https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_dispatch | ||
# - https://github.com/actions/checkout | ||
# - https://github.com/actions/setup-node | ||
# - https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#yarn2-configuration | ||
# - https://github.com/hmarr/debug-action | ||
# - https://github.com/kaisugi/action-regex-match | ||
# - https://regex101.com/r/OwpOr2 | ||
|
||
--- | ||
name: release-branch | ||
on: | ||
create: | ||
workflow_dispatch: | ||
inputs: | ||
dry: | ||
default: true | ||
description: dry run? | ||
type: boolean | ||
version: | ||
description: release version | ||
required: true | ||
type: string | ||
concurrency: | ||
cancel-in-progress: true | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
jobs: | ||
preflight: | ||
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref_name, 'release/') | ||
permissions: | ||
contents: read | ||
runs-on: ubuntu-latest | ||
outputs: | ||
tag: ${{ steps.tag.outputs.result }} | ||
version: ${{ inputs.version || steps.version.outputs.match }} | ||
steps: | ||
- id: debug | ||
name: Print environment variables and event payload | ||
uses: hmarr/debug-action@v2.1.0 | ||
- id: checkout | ||
name: Checkout ${{ github.ref_name }} | ||
uses: actions/checkout@v4.1.1 | ||
with: | ||
persist-credentials: false | ||
ref: ${{ github.ref }} | ||
- id: version | ||
name: Get release version | ||
uses: kaisugi/action-regex-match@v1.0.0 | ||
with: | ||
regex: | | ||
(?<=release\/)(?<version>(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[A-Za-z-][\dA-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][\dA-Za-z-]*))*))?(?:\+(?<metadata>[\dA-Za-z-]+(?:\.[\dA-Za-z-]+)*))?$) | ||
text: ${{ inputs.version && format('release/{0}', inputs.version) || github.ref_name }} | ||
- id: tag | ||
name: Get release tag | ||
run: | | ||
echo "result=$(jq .tagprefix grease.config.json -r)${{ steps.version.outputs.match }}" >>$GITHUB_OUTPUT | ||
prepare: | ||
if: needs.preflight.outputs.version != '' | ||
needs: preflight | ||
permissions: | ||
contents: write | ||
packages: read | ||
runs-on: ubuntu-latest | ||
env: | ||
DRY_RUN: ${{ fromJson(inputs.dry) || !startsWith(github.ref_name, 'release/') }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
HUSKY: 0 | ||
steps: | ||
- id: checkout | ||
name: Checkout ${{ github.ref_name }} | ||
uses: actions/checkout@v4.1.1 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.ref }} | ||
- id: gpg-import | ||
name: Import GPG key | ||
uses: crazy-max/ghaction-import-gpg@v6.0.0 | ||
with: | ||
git_commit_gpgsign: true | ||
git_config_global: true | ||
git_push_gpgsign: false | ||
git_user_signingkey: true | ||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.GPG_PASSPHRASE }} | ||
trust_level: 5 | ||
- id: yarn | ||
name: Install dependencies | ||
run: yarn --immutable | ||
- id: build | ||
name: Build project | ||
env: | ||
NODE_NO_WARNINGS: 1 | ||
run: yarn build | ||
- id: bump | ||
name: Bump manifest version to ${{ needs.preflight.outputs.version }} | ||
run: node ./dist/cli.mjs bump -w ${{ needs.preflight.outputs.version }} | ||
- id: changelog | ||
name: Add CHANGELOG entry for ${{ needs.preflight.outputs.tag }} | ||
run: node ./dist/cli.mjs changelog && node ./dist/cli.mjs changelog -sw | ||
- id: commit | ||
name: Commit release preparation | ||
run: | | ||
git add CHANGELOG.md package.json | ||
git status | ||
git commit -s -m 'release: ${{ needs.preflight.outputs.tag }}' | ||
git log --show-signature 'HEAD^..HEAD' | ||
- id: push | ||
name: Push release preparation | ||
run: git push${{ fromJson(env.DRY_RUN) && ' --dry-run' || '' }} --no-verify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.