Skip to content

Commit f7f4ce0

Browse files
authored
Workflow build and release fixes (#156)
* Updated action.yml * Fixed action build maven credentials * Build and release actions and workflows * Fixed release workflow
1 parent 9cf3799 commit f7f4ce0

File tree

6 files changed

+316
-81
lines changed

6 files changed

+316
-81
lines changed

.github/actions/build/action.yml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: 'Maven Build'
2+
3+
description: 'Build 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-username:
16+
description: 'The Maven username.'
17+
required: true
18+
19+
maven-password:
20+
description: 'The Maven password.'
21+
required: true
22+
23+
runs:
24+
using: "composite"
25+
steps:
26+
- name: Set up WebRTC cache
27+
uses: actions/cache@v4
28+
with:
29+
path: ~/${{ env.WEBRTC_INSTALL_FOLDER }}
30+
key: webrtc-${{ env.WEBRTC_CACHE_BRANCH }}-${{ inputs.platform-name }}-${{ hashFiles('webrtc-jni/pom.xml') }}
31+
restore-keys: webrtc-${{ env.WEBRTC_CACHE_BRANCH }}-${{ inputs.platform-name }}-
32+
33+
- name: Set up Maven cache
34+
uses: actions/cache@v4
35+
with:
36+
path: ~/.m2/repository
37+
key: maven-${{ inputs.platform-name }}-${{ hashFiles('**/pom.xml') }}
38+
restore-keys: maven-${{ inputs.platform-name }}-
39+
40+
- name: Set up JDK ${{ inputs.java-version }}
41+
uses: actions/setup-java@v4
42+
with:
43+
java-version: ${{ inputs.java-version }}
44+
distribution: 'temurin'
45+
server-id: ossrh
46+
server-username: MAVEN_USERNAME
47+
server-password: MAVEN_TOKEN
48+
49+
- name: Build
50+
run: mvn package -DskipTests
51+
shell: bash
52+
53+
- name: Test
54+
run: mvn -B jar:jar surefire:test
55+
shell: bash
56+
57+
- name: Deploy
58+
env:
59+
MAVEN_USERNAME: ${{ inputs.maven-username }}
60+
MAVEN_TOKEN: ${{ inputs.maven-password }}
61+
run: mvn deploy -DskipTests
62+
shell: bash

.github/maven-action/action.yml renamed to .github/actions/release/action.yml

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
name: 'Maven Build'
1+
name: 'Maven Release'
22

3-
description: 'Build the platform dependent Java library'
3+
description: 'Release the platform dependent Java library'
44

55
inputs:
66
java-version:
@@ -12,11 +12,11 @@ inputs:
1212
description: 'The target platform.'
1313
required: true
1414

15-
gpg-key:
15+
maven-gpg-private-key:
1616
description: 'The GPG private key to sign Maven artifacts.'
1717
required: true
1818

19-
gpg-pass:
19+
maven-gpg-passphrase:
2020
description: 'The GPG passphrase for the GPG key.'
2121
required: true
2222

@@ -53,10 +53,11 @@ runs:
5353
server-id: ossrh
5454
server-username: MAVEN_USERNAME
5555
server-password: MAVEN_TOKEN
56-
settings-path: ${{ github.workspace }}/.github/workflows
56+
gpg-private-key: ${{ inputs.maven-gpg-private-key }}
57+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
5758

5859
- name: Build
59-
run: mvn package -DskipTests -s .github/workflows/settings.xml
60+
run: mvn package -DskipTests
6061
shell: bash
6162

6263
- name: Test
@@ -67,5 +68,6 @@ runs:
6768
env:
6869
MAVEN_USERNAME: ${{ inputs.maven-username }}
6970
MAVEN_TOKEN: ${{ inputs.maven-password }}
70-
run: mvn deploy -DskipTests -s .github/workflows/settings.xml
71+
MAVEN_GPG_PASSPHRASE: ${{ inputs.maven-gpg-passphrase }}
72+
run: mvn deploy -Prelease -DskipTests
7173
shell: bash

.github/workflows/build.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ jobs:
6868
6969
- id: maven-build
7070
name: Maven build
71-
uses: ./.github/maven-action
71+
uses: ./.github/actions/build
7272
with:
7373
java-version: ${{ matrix.java }}
7474
platform-name: ${{ matrix.platform.name }}
7575
maven-username: ${{ secrets.MAVEN_USERNAME }}
76-
maven-password: ${{ secrets.MAVEN_PASSWORD }}
76+
maven-password: ${{ secrets.MAVEN_TOKEN }}
7777

7878
build-linux:
7979
strategy:
@@ -122,12 +122,12 @@ jobs:
122122
123123
- id: maven-build
124124
name: Maven build
125-
uses: ./.github/maven-action
125+
uses: ./.github/actions/build
126126
with:
127127
java-version: ${{ matrix.java }}
128128
platform-name: ${{ matrix.platform.name }}
129129
maven-username: ${{ secrets.MAVEN_USERNAME }}
130-
maven-password: ${{ secrets.MAVEN_PASSWORD }}
130+
maven-password: ${{ secrets.MAVEN_TOKEN }}
131131

132132
build-macos:
133133
strategy:
@@ -153,13 +153,13 @@ jobs:
153153
brew install python-setuptools
154154
155155
- name: Select Xcode version
156-
run: sudo xcode-select -s /Applications/Xcode_14.3.1.app/Contents/Developer
156+
run: sudo xcode-select -s /Applications/Xcode_15.0.1.app/Contents/Developer
157157

158158
- id: maven-build
159159
name: Maven build
160-
uses: ./.github/maven-action
160+
uses: ./.github/actions/build
161161
with:
162162
java-version: ${{ matrix.java }}
163163
platform-name: ${{ matrix.platform.name }}
164164
maven-username: ${{ secrets.MAVEN_USERNAME }}
165-
maven-password: ${{ secrets.MAVEN_PASSWORD }}
165+
maven-password: ${{ secrets.MAVEN_TOKEN }}

0 commit comments

Comments
 (0)