Skip to content

Commit 6fc33c1

Browse files
committed
fix: add Maven release action for macOS platforms
1 parent 7cc297f commit 6fc33c1

File tree

2 files changed

+89
-2
lines changed

2 files changed

+89
-2
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: 'Maven Release'
2+
3+
description: 'Release the platform dependent Java library'
4+
5+
inputs:
6+
java-version:
7+
description: 'The Java build version.'
8+
required: true
9+
default: '17'
10+
11+
platform-name:
12+
description: 'The target platform.'
13+
required: true
14+
15+
maven-gpg-private-key:
16+
description: 'The GPG private key to sign Maven artifacts.'
17+
required: true
18+
19+
maven-gpg-passphrase:
20+
description: 'The GPG passphrase for the GPG key.'
21+
required: true
22+
23+
maven-username:
24+
description: 'The Maven username.'
25+
required: true
26+
27+
maven-password:
28+
description: 'The Maven password.'
29+
required: true
30+
31+
runs:
32+
using: "composite"
33+
steps:
34+
- name: Set up WebRTC cache
35+
uses: actions/cache@v4
36+
with:
37+
path: ~/${{ env.WEBRTC_INSTALL_FOLDER }}
38+
key: webrtc-${{ env.WEBRTC_CACHE_BRANCH }}-${{ inputs.platform-name }}-${{ hashFiles('webrtc-jni/pom.xml') }}
39+
restore-keys: webrtc-${{ env.WEBRTC_CACHE_BRANCH }}-${{ inputs.platform-name }}-
40+
41+
- name: Set up Maven cache
42+
uses: actions/cache@v4
43+
with:
44+
path: ~/.m2/repository
45+
key: maven-${{ inputs.platform-name }}-${{ hashFiles('**/pom.xml') }}
46+
restore-keys: maven-${{ inputs.platform-name }}-
47+
48+
- name: Set up JDK ${{ inputs.java-version }}
49+
uses: actions/setup-java@v4
50+
with:
51+
architecture: 'x64'
52+
java-version: ${{ inputs.java-version }}
53+
distribution: 'temurin'
54+
server-id: central
55+
server-username: MAVEN_USERNAME
56+
server-password: MAVEN_TOKEN
57+
gpg-private-key: ${{ inputs.maven-gpg-private-key }}
58+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
59+
60+
- name: Build
61+
run: arch -x86_64 mvn package -DskipTests -Pmacos-cross-x86_64
62+
shell: bash
63+
64+
- name: Test
65+
run: arch -x86_64 mvn -B jar:jar surefire:test -Pmacos-cross-x86_64
66+
shell: bash
67+
68+
- name: Deploy
69+
env:
70+
MAVEN_USERNAME: ${{ inputs.maven-username }}
71+
MAVEN_TOKEN: ${{ inputs.maven-password }}
72+
MAVEN_GPG_PASSPHRASE: ${{ inputs.maven-gpg-passphrase }}
73+
run: arch -x86_64 mvn deploy -DskipTests -Pmacos-cross-x86_64 -Prelease
74+
shell: bash

.github/workflows/release.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,9 @@ jobs:
173173
name: Prepare release build
174174
uses: ./.github/actions/prepare-macos
175175

176-
- id: maven-build
177-
name: Maven build
176+
- id: maven-build-arm64
177+
name: Maven build - Apple Silicon
178+
if: matrix.platform.name == 'macos_arm64'
178179
uses: ./.github/actions/release
179180
with:
180181
java-version: ${{ matrix.java }}
@@ -183,3 +184,15 @@ jobs:
183184
maven-password: ${{ secrets.MAVEN_TOKEN }}
184185
maven-gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
185186
maven-gpg-passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
187+
188+
- id: maven-build-x86_64
189+
name: Maven build - Intel
190+
if: matrix.platform.name == 'macos_x86-64'
191+
uses: ./.github/actions/release-macos-x86_64
192+
with:
193+
java-version: ${{ matrix.java }}
194+
platform-name: ${{ matrix.platform.name }}
195+
maven-username: ${{ secrets.MAVEN_USERNAME }}
196+
maven-password: ${{ secrets.MAVEN_TOKEN }}
197+
maven-gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
198+
maven-gpg-passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

0 commit comments

Comments
 (0)