-
Notifications
You must be signed in to change notification settings - Fork 16
88 lines (74 loc) · 2.62 KB
/
release.yml
File metadata and controls
88 lines (74 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Release
on:
workflow_dispatch:
inputs:
release_version:
description: 'Release version (e.g. 3.2.3)'
required: true
next_snapshot:
description: 'Next development version (default: auto-increment patch, e.g. 3.2.4) without the "-SNAPSHOT" word'
required: false
permissions:
contents: write
id-token: write
attestations: write
defaults:
run:
shell: bash
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Set release version
run: mvn versions:set -DnewVersion=${{ inputs.release_version }} -DgenerateBackupPoms=false
- name: Build Release
run: mvn package appassembler:assemble assembly:single checksum:files -DskipTests
- name: Attest build provenance
uses: actions/attest-build-provenance@v2
with:
subject-path: |
target/utPLSQL-cli.zip
target/utPLSQL-cli.zip.sha256
- name: Commit and tag release version
run: |
git add pom.xml
git commit -m "Release v${{ inputs.release_version }}"
git tag -a "v${{ inputs.release_version }}" -m "Release ${{ inputs.release_version }}"
- name: Calculate and set next development version
run: |
if [[ -n "${{ inputs.next_snapshot }}" ]]; then
NEXT="${{ inputs.next_snapshot }}-SNAPSHOT"
else
IFS='.' read -r major minor patch <<< "${{ inputs.release_version }}"
NEXT="${major}.${minor}.$((patch + 1))-SNAPSHOT"
fi
mvn -B versions:set -DnewVersion="$NEXT" -DgenerateBackupPoms=false
git add pom.xml
git commit -m "Prepare next development version $NEXT [skip ci]"
- name: Push commits and tag
run: |
git push origin HEAD:${{ github.ref_name }}
git push origin "v${{ inputs.release_version }}"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ inputs.release_version }}
name: "utPLSQL-cli v${{ inputs.release_version }}"
generate_release_notes: true
fail_on_unmatched_files: true
files: |
target/utPLSQL-cli.zip
target/utPLSQL-cli.zip.sha256