-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #537 from axonivy/drafterV2
automate release-drafter publishing 🗞️
- Loading branch information
Showing
6 changed files
with
81 additions
and
71 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,49 @@ | ||
name: Release Publisher | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
publish: | ||
required: false | ||
default: true | ||
type: boolean | ||
version: | ||
required: true | ||
type: string | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
publish_release: | ||
permissions: | ||
contents: write | ||
pull-requests: read | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set version env | ||
run: | | ||
RELEASE_VERSION="${{ inputs.version }}"; | ||
if [ -z "$RELEASE_VERSION" ]; then | ||
RELEASE_VERSION="${GITHUB_REF#refs/*/}" | ||
fi; | ||
echo RELEASE_VERSION=$RELEASE_VERSION >> $GITHUB_ENV | ||
MINOR=${RELEASE_VERSION%.*} | ||
MINOR=${MINOR#v} | ||
TARGET=release/${MINOR} | ||
if [[ "${GITHUB_REF#refs/*/}" -eq "master" ]]; then | ||
TARGET="master" | ||
fi | ||
echo RELEASE_TARGET=$TARGET >> $GITHUB_ENV | ||
- uses: release-drafter/release-drafter@v6 | ||
with: | ||
config-name: release-drafter.yml | ||
disable-autolabeler: true | ||
name: ${{ env.RELEASE_VERSION }} | ||
tag: ${{ env.RELEASE_VERSION }} | ||
version: ${{ env.RELEASE_VERSION }} | ||
commitish: ${{ env.RELEASE_TARGET }} | ||
publish: ${{ inputs.publish }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,29 @@ | ||
name: Tag Publisher | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
type: string | ||
description: the tag-ref to release e.g. 'v12.0.0' | ||
publish: | ||
type: boolean | ||
default: false | ||
description: publish the drafted release as final version? | ||
|
||
|
||
permissions: | ||
contents: write | ||
pull-requests: read | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/draft-pub.yml | ||
with: | ||
version: ${{ inputs.tag }} | ||
# The 'publish' input parameter is used to control whether the release should be published automatically. | ||
# Uncomment and set to 'false' if you want to prevent the release from being published immediately. | ||
publish: ${{ inputs.publish == null && true || inputs.publish }} |
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