|
| 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 |
0 commit comments