Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8ddc4fc

Browse files
author
Jacek Gębal
committed
Update of release process.
1 parent fecefd6 commit 8ddc4fc

2 files changed

Lines changed: 63 additions & 23 deletions

File tree

.github/workflows/release.yml

Lines changed: 62 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
1-
name: Release
1+
name: Prepare Release
22

33
on:
4-
push:
5-
tags:
6-
- "v*.*.*"
7-
84
workflow_dispatch:
5+
inputs:
6+
releaseVersion:
7+
description: 'Release version (e.g. 3.2.0)'
8+
required: true
9+
nextDevVersion:
10+
description: 'Next development version (default: auto-increment patch, e.g. 3.2.1-SNAPSHOT)'
11+
required: false
912

10-
jobs:
11-
12-
release:
13+
permissions:
14+
contents: write
15+
id-token: write
16+
attestations: write
1317

18+
jobs:
19+
prepare-and-release:
1420
runs-on: ubuntu-latest
1521

1622
steps:
@@ -23,13 +29,58 @@ jobs:
2329
with:
2430
distribution: 'temurin'
2531
java-version: '21'
32+
cache: 'maven'
33+
34+
- name: Configure Git
35+
run: |
36+
git config user.name "github-actions[bot]"
37+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
38+
39+
- name: Set release version
40+
run: mvn -B versions:set -DnewVersion=${{ inputs.releaseVersion }} -DgenerateBackupPoms=false
41+
42+
- name: Commit and tag release
43+
run: |
44+
git add pom.xml
45+
git commit -m "Release v${{ inputs.releaseVersion }}"
46+
git tag "v${{ inputs.releaseVersion }}"
47+
48+
- name: Calculate and set next development version
49+
run: |
50+
if [[ -n "${{ inputs.nextDevVersion }}" ]]; then
51+
NEXT="${{ inputs.nextDevVersion }}"
52+
else
53+
IFS='.' read -r major minor patch <<< "${{ inputs.releaseVersion }}"
54+
NEXT="${major}.${minor}.$((patch + 1))-SNAPSHOT"
55+
fi
56+
mvn -B versions:set -DnewVersion="$NEXT" -DgenerateBackupPoms=false
57+
git add pom.xml
58+
git commit -m "Prepare next development version $NEXT"
59+
60+
- name: Push branch and tag
61+
run: |
62+
git push origin HEAD:${{ github.ref_name }}
63+
git push origin "v${{ inputs.releaseVersion }}"
64+
65+
- name: Checkout release tag for build
66+
run: git checkout "v${{ inputs.releaseVersion }}"
2667

2768
- name: Build Release
2869
run: mvn package appassembler:assemble assembly:single checksum:files -DskipTests
2970

30-
- name: Release
31-
uses: softprops/[email protected]
71+
- name: Attest build provenance
72+
uses: actions/attest-build-provenance@v2
73+
with:
74+
subject-path: |
75+
target/utPLSQL-cli.zip
76+
target/utPLSQL-cli.zip.sha256
77+
78+
- name: Create GitHub Release
79+
uses: softprops/action-gh-release@v2
3280
with:
81+
tag_name: v${{ inputs.releaseVersion }}
82+
generate_release_notes: true
83+
fail_on_unmatched_files: true
3384
files: |
3485
target/utPLSQL-cli.zip
35-
target/utPLSQL-cli.zip.md5
86+
target/utPLSQL-cli.zip.sha256

pom.xml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -177,21 +177,10 @@
177177
</fileSet>
178178
</fileSets>
179179
<algorithms>
180-
<algorithm>MD5</algorithm>
180+
<algorithm>SHA-256</algorithm>
181181
</algorithms>
182182
</configuration>
183183
</plugin>
184-
<plugin>
185-
<groupId>com.amashchenko.maven.plugin</groupId>
186-
<artifactId>gitflow-maven-plugin</artifactId>
187-
<version>1.21.0</version>
188-
<configuration>
189-
<verbose>true</verbose>
190-
<gitFlowConfig>
191-
<productionBranch>main</productionBranch>
192-
</gitFlowConfig>
193-
</configuration>
194-
</plugin>
195184
</plugins>
196185
<resources>
197186
<resource>

0 commit comments

Comments
 (0)