Skip to content

Commit b9dffad

Browse files
committed
New release script
1 parent 9116655 commit b9dffad

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

.github/workflows/release_new.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Master release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
releaseVersion:
7+
description: 'Release and tag version (ie 5.5.0)'
8+
required: true
9+
developmentVersion:
10+
description: 'Next development version, with SNAPSHOT'
11+
required: true
12+
13+
jobs:
14+
master_release:
15+
if: "!contains(github.event.head_commit.message, '[maven-release-plugin]')"
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
with:
21+
# Fetch all history for all tags and branches
22+
fetch-depth: 0
23+
# Use PAT instead of the default GITHUB_TOKEN for authentication
24+
token: ${{ secrets.GH_PACKAGE_REPO_PASSWORD }}
25+
26+
- name: Set up JDK 11
27+
uses: actions/setup-java@v4
28+
with:
29+
java-version: '11'
30+
distribution: 'temurin'
31+
32+
- name: Initialize mandatory git config
33+
run: |
34+
git config user.name "GitHub Actions"
35+
git config user.email [email protected]
36+
37+
- name: Configure Git HTTPS authentication
38+
run: |
39+
git config --global url."https://${{ secrets.GH_PACKAGE_REPO_PASSWORD }}@github.com/".insteadOf "[email protected]:"
40+
git remote set-url origin https://${{ secrets.GH_PACKAGE_REPO_PASSWORD }}@github.com/${{ github.repository }}.git
41+
42+
- name: Release with Maven
43+
env:
44+
GITHUB_USERNAME: ${{ github.actor }}
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
GH_PACKAGE_REPO_PASSWORD: ${{ secrets.GH_PACKAGE_REPO_PASSWORD }}
47+
run: |
48+
mvn -B -Dtag=${{ github.event.inputs.releaseVersion }} release:prepare \
49+
-DreleaseVersion=${{ github.event.inputs.releaseVersion }} \
50+
-DdevelopmentVersion=${{ github.event.inputs.developmentVersion }} --file pom.xml \
51+
&& mvn release:perform -B --file pom.xml
52+
53+
- name: Create A Pull Request
54+
uses: thomaseizinger/[email protected]
55+
with:
56+
github_token: ${{ secrets.GH_PACKAGE_REPO_PASSWORD }}
57+
head: master
58+
base: develop
59+
title: Released master into develop
60+
body: |
61+
Hi!
62+
This PR was created in response workflow running.
63+
I've updated the version name and code commit: ${{ steps.make-commit.outputs.commit }}.

0 commit comments

Comments
 (0)