Skip to content

Commit b421274

Browse files
committed
Gradle Release initial workflow setup
[skip ci]
1 parent 3f3e7d7 commit b421274

File tree

2 files changed

+114
-1
lines changed

2 files changed

+114
-1
lines changed

.github/workflows/pull_request-gradle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Pull Requests
1+
name: Pull Requests with Gradle
22
on:
33
pull_request:
44
paths-ignore:

.github/workflows/release-gradle.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: Releases
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
version:
8+
runs-on: ubuntu-latest
9+
outputs:
10+
build_number: ${{ steps.tag_info.outputs.build_number }}
11+
version: ${{ steps.tag_info.outputs.version }}
12+
steps:
13+
- name: Extract version and build number
14+
id: tag_info
15+
shell: bash
16+
run: |
17+
TAG_NAME="${GITHUB_REF#refs/tags/}"
18+
BUILD_NUMBER=$(echo "$TAG_NAME" | cut -d'-' -f2)
19+
VERSION=$(echo "$TAG_NAME" | cut -d'-' -f3)
20+
21+
# Set outputs for use in later jobs or steps
22+
echo "build_number=$BUILD_NUMBER" >> $GITHUB_OUTPUT
23+
echo "version=$VERSION" >> $GITHUB_OUTPUT
24+
publish:
25+
name: Publish Processing Core to Maven Central
26+
runs-on: ubuntu-latest
27+
needs: version
28+
steps:
29+
- name: Checkout Repository
30+
uses: actions/checkout@v4
31+
- name: Setup Java
32+
uses: actions/setup-java@v4
33+
with:
34+
distribution: 'temurin'
35+
java-version: 17
36+
- name: Setup Gradle
37+
uses: gradle/actions/setup-gradle@v4
38+
- name: Build with Gradle
39+
run: ./gradlew publish
40+
env:
41+
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
42+
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
43+
44+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
45+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
46+
47+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_IN_MEMORY_KEY }}
48+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_IN_MEMORY_KEY_PASSWORD }}
49+
50+
ORG_GRADLE_PROJECT_version: ${{ needs.version.outputs.version }}
51+
ORG_GRADLE_PROJECT_group: ${{ vars.PROCESSING_GROUP }}
52+
build:
53+
name: Publish Release for ${{ matrix.os_prefix }} (${{ matrix.arch }})
54+
runs-on: ${{ matrix.os }}
55+
needs: version
56+
permissions:
57+
contents: write
58+
strategy:
59+
fail-fast: false
60+
matrix:
61+
include:
62+
# compiling for arm32 needs a self-hosted runner on Raspi OS (32-bit)
63+
- os: [self-hosted, linux, ARM]
64+
os_prefix: linux
65+
arch: arm
66+
- os: ubuntu-latest
67+
os_prefix: linux
68+
arch: x64
69+
- os: windows-latest
70+
os_prefix: windows
71+
arch: x64
72+
- os: macos-latest
73+
os_prefix: macos
74+
arch: x64
75+
- os: macos-latest
76+
os_prefix: macos
77+
arch: aarch64
78+
- os: macos-latest
79+
os_prefix: linux
80+
arch: aarch64
81+
steps:
82+
- name: Checkout Repository
83+
uses: actions/checkout@v4
84+
- name: Install Java
85+
uses: actions/setup-java@v4
86+
with:
87+
java-version: '17'
88+
distribution: 'temurin'
89+
architecture: ${{ matrix.arch }}
90+
- name: Setup Gradle
91+
uses: gradle/actions/setup-gradle@v4
92+
# - name: Install Certificates for Code Signing
93+
# if: ${{ matrix.os_prefix == 'macos' }}
94+
# uses: apple-actions/import-codesign-certs@v3
95+
# with:
96+
# p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
97+
# p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
98+
- name: Build with Gradle
99+
run: ./gradlew packageDistributionForCurrentOS
100+
env:
101+
ORG_GRADLE_PROJECT_version: ${{ needs.version.outputs.version }}
102+
ORG_GRADLE_PROJECT_group: ${{ vars.PROCESSING_GROUP }}
103+
104+
- name: Upload binaries to release
105+
uses: svenstaro/upload-release-action@v2
106+
with:
107+
repo_token: ${{ secrets.GITHUB_TOKEN }}
108+
file: |
109+
./app/build/compose/binaries/main/dmg/Processing-*.dmg
110+
./app/build/compose/binaries/main/dmg/INSTRUCTIONS_FOR_TESTING.txt
111+
./app/build/compose/binaries/main/msi/Processing-*.msi
112+
./app/build/compose/binaries/main/deb/processing*.deb
113+
file_glob: true

0 commit comments

Comments
 (0)