-
Notifications
You must be signed in to change notification settings - Fork 2
113 lines (101 loc) · 3.43 KB
/
release.yml
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Release
on:
workflow_dispatch:
inputs:
skip-maven-central:
description: "Skip deployment to Maven Central"
required: true
type: boolean
default: false
jobs:
build-native-packages:
strategy:
matrix:
os: ['ubuntu-latest', 'windows-latest']
env:
DEFAULT_OS: 'ubuntu-latest'
runs-on: ${{ matrix.os }}
permissions:
contents: read
defaults:
run:
shell: bash
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Build
run: ./gradlew build jpackage --info --warning-mode all -PskipFlakyTests=true -x test -x uiTest
- name: Archive executable JAR
uses: actions/upload-artifact@v4
if: ${{ env.DEFAULT_OS == matrix.os }}
with:
name: executable-jar
retention-days: 5
if-no-files-found: error
path: |
jfxui/build/libs/white-rabbit-fx-*.jar
jfxui/build/libs-checksums/*
- name: Archive native package for ${{ runner.os }}
uses: actions/upload-artifact@v4
with:
name: native-package-${{ runner.os }}
retention-days: 5
if-no-files-found: error
path: |
jfxui/build/jpackage-dist/*
jfxui/build/jpackage-checksums/*
release:
runs-on: ubuntu-latest
needs: build-native-packages
defaults:
run:
shell: "bash"
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
permissions:
contents: write # Required for creating GitHub release
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
# - name: Fail if not running on main branch
# if: ${{ github.ref != 'refs/heads/main' }}
# uses: actions/github-script@v7
# with:
# script: |
# core.setFailed('Not running on main branch, github.ref is ${{ github.ref }}. Please start this workflow only on main')
- name: Publish to Central Repository
if: ${{ ! inputs.skip-maven-central }}
#run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --info --warning-mode all
run: ./gradlew publishToSonatype closeSonatypeStagingRepository --info --warning-mode all --stacktrace --scan
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: build/release-artifacts
- name: List artifacts
run: |
find build/release-artifacts -type f
ls -lh build/release-artifacts
- name: Create GitHub Release
run: ./.github/workflows/github_release.sh
env:
GH_TOKEN: ${{ github.token }}