-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (72 loc) · 2.61 KB
/
Copy pathrelease.yml
File metadata and controls
87 lines (72 loc) · 2.61 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
name: Release
on:
push:
tags:
- 'v*'
env:
# WS-1.1 FIRE(commit 38c514a)统一 Java 版本到 21 后,该值必须与
# pom.xml `<java.version>21</java.version>`(以及 maven.compiler.source/target)
# 对齐,否则 release 时会用 JDK 17 编译 Java 21 源码必失败。CI.yml 已修正为
# '21',release.yml 此处为遗留(loop round 8 修复)。
JAVA_VERSION: '21'
jobs:
release:
name: Release to Maven Central
runs-on: ubuntu-latest
environment:
name: maven-central
url: https://s01.oss.sonatype.org/
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: ./.github/actions/setup-jdk-21
with:
server-id: central
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
- name: Extract Version
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Update POM Version
run: ./mvnw versions:set -DnewVersion=${{ steps.version.outputs.VERSION }} -B
- name: Build & Test
run: ./mvnw clean verify -B
env:
MAVEN_OPTS: -Xmx1024m
- name: Deploy to Maven Central
run: ./mvnw deploy -B -DskipTests=false
env:
MAVEN_OPTS: -Xmx1024m
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Create GitHub Release
if: success()
uses: softprops/action-gh-release@v2
with:
body: |
## What's Changed
See [commits](${{ github.server_url }}/${{ github.repository }}/compare/${{ github.event.before }}...${{ github.sha }}) for details.
## Docker Images
N/A
draft: false
prerelease: ${{ contains(steps.version.outputs.VERSION, 'alpha') || contains(steps.version.outputs.VERSION, 'beta') || contains(steps.version.outputs.VERSION, 'rc') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-conda:
name: Notify Release Complete
runs-on: ubuntu-latest
needs: [release]
if: always()
steps:
- name: Create Release Status
run: |
if [[ "${{ needs.release.result }}" == "success" ]]; then
echo "✅ Release ${{ github.ref_name }} published successfully to Maven Central!"
else
echo "❌ Release failed. Check the logs."
exit 1
fi