Skip to content

Commit cdb4027

Browse files
juancho0202Stef3st
andauthored
ci: refactor release please workflow (#261)
* ci: refactor release please workflow Signed-off-by: Juan Munoz <[email protected]> * docs: add changelog Signed-off-by: Juan Munoz <[email protected]> * chore: of course Succumbing to the irresistible allure of a life devoid of human connection, powered by REUSE.software Signed-off-by: Juan Munoz <[email protected]> --------- Signed-off-by: Juan Munoz <[email protected]> Signed-off-by: Steffen van den Driest <[email protected]> Co-authored-by: Steffen van den Driest <[email protected]>
1 parent 4ef0abd commit cdb4027

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

.github/workflows/release-please.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,68 +15,67 @@ name: release-please
1515
jobs:
1616
release_please:
1717
runs-on: ubuntu-latest
18-
outputs:
19-
release_created: ${{ steps.release.outputs.release_created }}
2018
steps:
2119
- uses: google-github-actions/release-please-action@v4
2220
id: release
2321
with:
2422
release-type: maven
2523
package-name: compas-scl-auto-alignment
26-
# The logic below handles the docker hub publication:
27-
push_to_registry:
28-
needs: release_please
29-
if: needs.release_please.outputs.release_created == "true"
30-
name: Build and publish
31-
runs-on: ubuntu-latest
32-
timeout-minutes: 15
33-
34-
steps:
3524
- name: Checkout
25+
if: ${{ steps.release.outputs.release_created }}
3626
uses: actions/checkout@v4
3727

3828
- name: Cache Docker Register
29+
if: ${{ steps.release.outputs.release_created }}
3930
uses: actions/cache@v3
4031
with:
4132
path: /tmp/.buildx-cache
4233
key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }}
4334
- name: Cache Maven packages
35+
if: ${{ steps.release.outputs.release_created }}
4436
uses: actions/cache@v3
4537
with:
4638
path: ~/.m2
4739
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
4840
restore-keys: ${{ runner.os }}-m2
4941

5042
- name: Extract tag name
43+
if: ${{ steps.release.outputs.release_created }}
5144
id: extract_tagname
5245
shell: bash
5346
# Extract the tag name from the git reference, value of GITHUB_REF will be something like refs/tags/<tag_name>.
5447
run: echo "##[set-output name=tagname;]$(echo ${GITHUB_REF##*/})"
5548

5649
- name: Set up JDK 17
50+
if: ${{ steps.release.outputs.release_created }}
5751
uses: actions/setup-java@v4
5852
with:
5953
distribution: 'zulu'
6054
java-version: '17'
6155
- name: Set up Docker Buildx
56+
if: ${{ steps.release.outputs.release_created }}
6257
id: buildx
6358
uses: docker/setup-buildx-action@v3
6459
- name: Login to Docker Hub
60+
if: ${{ steps.release.outputs.release_created }}
6561
uses: docker/login-action@v3
6662
with:
6763
username: ${{ secrets.DOCKER_HUB_USERNAME }}
6864
password: ${{ secrets.DOCKER_HUB_TOKEN }}
6965

7066
- name: Create custom Maven Settings.xml
67+
if: ${{ steps.release.outputs.release_created }}
7168
uses: whelk-io/maven-settings-xml-action@v21
7269
with:
7370
output_file: custom_maven_settings.xml
7471
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
7572
- name: Set version with Maven
73+
if: ${{ steps.release.outputs.release_created }}
7674
run: ./mvnw -B versions:set -DprocessAllModules=true -DnewVersion=${{ steps.extract_tagname.outputs.tagname }}
7775
env:
7876
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7977
- name: Deploy with Maven to GitHub Packages and Docker Hub
78+
if: ${{ steps.release.outputs.release_created }}
8079
run: ./mvnw -B -s custom_maven_settings.xml -Pnative-image,release clean deploy
8180
env:
8281
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2023 Alliander N.V.
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
-->
6+
For older changelogs, please check the release tag on GitHub.

0 commit comments

Comments
 (0)