-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (66 loc) · 2.22 KB
/
beta-java.yml
File metadata and controls
74 lines (66 loc) · 2.22 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
name: Beta Release (Java)
on:
push:
branches: [java]
paths: ['src/**', 'pom.xml']
workflow_dispatch:
jobs:
beta:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '25'
cache: 'maven'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- 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
env:
BETA_VERSION: ${{ steps.version.outputs.version }}
run: mvn versions:set -DnewVersion="$BETA_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 }}
run: mvn deploy -DskipTests -Dgpg.skip=true -B
- name: Create git tag
env:
BETA_TAG: ${{ steps.version.outputs.tag }}
BETA_VERSION: ${{ steps.version.outputs.version }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "$BETA_TAG" -m "Beta release $BETA_VERSION"
git push origin "$BETA_TAG"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.tag }}
name: "Beta ${{ steps.version.outputs.version }}"
prerelease: true
generate_release_notes: true
files: target/code-iq-*.jar