Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow build and release fixes #156

Merged
merged 4 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: 'Maven Build'

description: 'Build the platform dependent Java library'

inputs:
java-version:
description: 'The Java build version.'
required: true
default: '17'

platform-name:
description: 'The target platform.'
required: true

maven-username:
description: 'The Maven username.'
required: true

maven-password:
description: 'The Maven password.'
required: true

runs:
using: "composite"
steps:
- name: Set up WebRTC cache
uses: actions/cache@v4
with:
path: ~/${{ env.WEBRTC_INSTALL_FOLDER }}
key: webrtc-${{ env.WEBRTC_CACHE_BRANCH }}-${{ inputs.platform-name }}-${{ hashFiles('webrtc-jni/pom.xml') }}
restore-keys: webrtc-${{ env.WEBRTC_CACHE_BRANCH }}-${{ inputs.platform-name }}-

- name: Set up Maven cache
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: maven-${{ inputs.platform-name }}-${{ hashFiles('**/pom.xml') }}
restore-keys: maven-${{ inputs.platform-name }}-

- name: Set up JDK ${{ inputs.java-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ inputs.java-version }}
distribution: 'temurin'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_TOKEN

- name: Build
run: mvn package -DskipTests
shell: bash

- name: Test
run: mvn -B jar:jar surefire:test
shell: bash

- name: Deploy
env:
MAVEN_USERNAME: ${{ inputs.maven-username }}
MAVEN_TOKEN: ${{ inputs.maven-password }}
run: mvn deploy -DskipTests
shell: bash
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'Maven Build'
name: 'Maven Release'

description: 'Build the platform dependent Java library'
description: 'Release the platform dependent Java library'

inputs:
java-version:
Expand All @@ -12,11 +12,11 @@ inputs:
description: 'The target platform.'
required: true

gpg-key:
maven-gpg-private-key:
description: 'The GPG private key to sign Maven artifacts.'
required: true

gpg-pass:
maven-gpg-passphrase:
description: 'The GPG passphrase for the GPG key.'
required: true

Expand Down Expand Up @@ -53,10 +53,11 @@ runs:
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_TOKEN
settings-path: ${{ github.workspace }}/.github/workflows
gpg-private-key: ${{ inputs.maven-gpg-private-key }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Build
run: mvn package -DskipTests -s .github/workflows/settings.xml
run: mvn package -DskipTests
shell: bash

- name: Test
Expand All @@ -67,5 +68,6 @@ runs:
env:
MAVEN_USERNAME: ${{ inputs.maven-username }}
MAVEN_TOKEN: ${{ inputs.maven-password }}
run: mvn deploy -DskipTests -s .github/workflows/settings.xml
MAVEN_GPG_PASSPHRASE: ${{ inputs.maven-gpg-passphrase }}
run: mvn deploy -Prelease -DskipTests
shell: bash
14 changes: 7 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ jobs:

- id: maven-build
name: Maven build
uses: ./.github/maven-action
uses: ./.github/actions/build
with:
java-version: ${{ matrix.java }}
platform-name: ${{ matrix.platform.name }}
maven-username: ${{ secrets.MAVEN_USERNAME }}
maven-password: ${{ secrets.MAVEN_PASSWORD }}
maven-password: ${{ secrets.MAVEN_TOKEN }}

build-linux:
strategy:
Expand Down Expand Up @@ -122,12 +122,12 @@ jobs:

- id: maven-build
name: Maven build
uses: ./.github/maven-action
uses: ./.github/actions/build
with:
java-version: ${{ matrix.java }}
platform-name: ${{ matrix.platform.name }}
maven-username: ${{ secrets.MAVEN_USERNAME }}
maven-password: ${{ secrets.MAVEN_PASSWORD }}
maven-password: ${{ secrets.MAVEN_TOKEN }}

build-macos:
strategy:
Expand All @@ -153,13 +153,13 @@ jobs:
brew install python-setuptools

- name: Select Xcode version
run: sudo xcode-select -s /Applications/Xcode_14.3.1.app/Contents/Developer
run: sudo xcode-select -s /Applications/Xcode_15.0.1.app/Contents/Developer

- id: maven-build
name: Maven build
uses: ./.github/maven-action
uses: ./.github/actions/build
with:
java-version: ${{ matrix.java }}
platform-name: ${{ matrix.platform.name }}
maven-username: ${{ secrets.MAVEN_USERNAME }}
maven-password: ${{ secrets.MAVEN_PASSWORD }}
maven-password: ${{ secrets.MAVEN_TOKEN }}
Loading