-
Notifications
You must be signed in to change notification settings - Fork 30
77 lines (67 loc) · 2.5 KB
/
Copy pathrelease.yml
File metadata and controls
77 lines (67 loc) · 2.5 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
name: release
run-name: release ${{ inputs.version }}
on:
workflow_dispatch:
inputs:
version:
description: "Release version (e.g. 3.0.0)"
required: true
type: string
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Java 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "17"
cache: maven
- name: Create release draft
uses: ncipollo/release-action@v1
with:
tag: v${{ inputs.version }}
name: ${{ inputs.version }}
draft: true
- name: Set maven project version
run: mvn --batch-mode --no-transfer-progress versions:set -DnewVersion=${{ inputs.version }}
- name: Commit release version
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "[skip ci] Set release version ${{ inputs.version }}"
branch: master
file_pattern: "pom.xml"
- name: Build and test
run: xvfb-run -a mvn --batch-mode --no-transfer-progress clean install
- name: Publish to Maven Central
run: .github/maven-central-deploy.sh
env:
GPG_SECRET_KEYS: ${{ secrets.GPG_SECRET_KEYS }}
GPG_OWNERTRUST: ${{ secrets.GPG_OWNERTRUST }}
GPG_EXECUTABLE: gpg
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
- name: Publish GitHub release
uses: ncipollo/release-action@v1
with:
tag: v${{ inputs.version }}
allowUpdates: true
omitNameDuringUpdate: true
omitBodyDuringUpdate: true
updateOnlyUnreleased: true
draft: false
artifacts: "target/jmeter-bzm-http2-${{ inputs.version }}.jar"
- name: Compute next SNAPSHOT version
run: |
IFS='.' read -r major minor patch <<< "${{ inputs.version }}"
echo "SNAPSHOT_VERSION=${major}.${minor}.$((patch + 1))-SNAPSHOT" >> $GITHUB_ENV
- name: Update to next SNAPSHOT version
run: mvn --batch-mode --no-transfer-progress versions:set -DnewVersion=${{ env.SNAPSHOT_VERSION }}
- name: Commit SNAPSHOT version
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "[skip ci] Set SNAPSHOT version ${{ env.SNAPSHOT_VERSION }}"
branch: master
file_pattern: "pom.xml"