Skip to content

Commit

Permalink
Merge pull request #537 from axonivy/drafterV2
Browse files Browse the repository at this point in the history
automate release-drafter publishing 🗞️
  • Loading branch information
ivy-rew authored Nov 26, 2024
2 parents 24f818e + e503c97 commit e19bd6f
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 71 deletions.
42 changes: 0 additions & 42 deletions .github/release-drafter-lts12.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name-template: 'v$RESOLVED_VERSION 🧪'
tag-template: 'v$RESOLVED_VERSION'
filter-by-commitish: false
commitish: master
categories:
- title: '🚀 Features'
labels:
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/draft-publisher.yml
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 }}
1 change: 1 addition & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ jobs:
- uses: release-drafter/release-drafter@v6
with:
config-name: release-drafter.yml
commitish: ${{ github.ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29 changes: 29 additions & 0 deletions .github/workflows/tag-publisher.yml
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 }}
29 changes: 2 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,35 +43,10 @@ Since 9.4: Releasing is only possible on a release branch.

Wait until the maven central release is available: this may take several hours until it's fully distributed.
- Publish the latest [draft release](https://github.com/axonivy/project-build-plugin/releases) do preserve the current changelog.
- Select the tag which was created for this release by the release-pipeline
- Verify that the title is correct
- Set the release as 'latest release'
- Publish it
- Release-Drafter changes, if a new-release train was introduced:
- on `master` branch:
- add a new release-drafter template for this new release by duplicating the existing and adding a release postfix e.g.`.github/release-drafter-lts14.yml`
- adjust the content of the duplicated file:
```yaml
filter-by-commitish: true
commitish: release/14.0
```
- on the release branch:
- change the `.github/workflow/release-drafter.yml` to listen only for changes from ~~master~~ to `release/XYZ` and refer the new template from master by name in the [config-name](.github/workflow/release-drafter.yml#32) part (e.g. `release-drafter-lts14.yml` )
- on github UI (PR View):
- flag the latest PR which was only merged to master with the label `major`
- ... now release-drafter action runs should create new draft PRs for the new release; without overwriting the existing master drafts.
- on github UI (PR View): flag the latest PR which was only merged to master with the label `major`.
... now release-drafter action runs should create new draft PRs for the new release; without overwriting the existing master drafts.
- Raise project-build-plugin in other repos by triggering this [build](https://jenkins.ivyteam.io/view/jobs/job/github-repo-manager_raise-build-plugin-version/job/master/)
Expand Down

0 comments on commit e19bd6f

Please sign in to comment.