-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (62 loc) · 2.39 KB
/
beta-java.yml
File metadata and controls
70 lines (62 loc) · 2.39 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
name: Beta Release (Java)
on:
workflow_dispatch: # Manual trigger ONLY
jobs:
beta:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.2.2
with:
fetch-depth: 0
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v4.7.1
with:
distribution: 'temurin'
java-version: '25'
cache: 'maven'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Determine beta version
id: version
run: |
LATEST_BETA=$(git tag -l 'v0.0.1-beta.*' | sort -V | tail -1)
if [ -z "$LATEST_BETA" ]; then
NEXT_NUM=0
else
CURRENT_NUM=$(echo "$LATEST_BETA" | grep -oP 'beta\.\K[0-9]+')
NEXT_NUM=$((CURRENT_NUM + 1))
fi
VERSION="0.0.1-beta.${NEXT_NUM}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "tag=v$VERSION" >> $GITHUB_OUTPUT
echo "Next beta version: $VERSION"
- name: Set version in pom.xml
run: mvn versions:set -DnewVersion=${{ steps.version.outputs.version }} -B
- name: Build and test
run: mvn clean verify -B
- name: Deploy to Maven Central
env:
MAVEN_USERNAME: ${{ secrets.OSS_NEXUS_USER }}
MAVEN_PASSWORD: ${{ secrets.OSS_NEXUS_PASS }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
run: mvn deploy -P release -DskipTests -B
- name: Create git tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a ${{ steps.version.outputs.tag }} -m "Beta release ${{ steps.version.outputs.version }}"
git push origin ${{ steps.version.outputs.tag }}
- name: Create GitHub Release
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
with:
tag_name: ${{ steps.version.outputs.tag }}
name: "Beta ${{ steps.version.outputs.version }}"
prerelease: true
generate_release_notes: true
files: |
target/code-iq-*-cli.jar