Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automate release-drafter publishing 🗞️ #537

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading