FlyCI macos build is sunsetting. We could just use macos-14 nowadays. #122
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'build' | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
create_staging_repository: | |
runs-on: ubuntu-22.04 | |
name: Create staging repository | |
outputs: | |
repository_id: ${{ steps.create.outputs.repository_id }} | |
steps: | |
- id: create | |
name: create OSSRH Repository for aggregated pushes (ONLY FOR RELEASES) | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: nexus-actions/create-nexus-staging-repo@main | |
with: | |
username: atsushieno | |
password: ${{ secrets.OSSRH_PASSWORD }} | |
staging_profile_id: 1b92322eb8632e | |
description: ${{ github.repository }}/${{ github.workflow }}#${{ github.run_number }} | |
base_url: https://s01.oss.sonatype.org/service/local/ | |
build_jar: | |
name: 'build on ${{ matrix.os }}' | |
runs-on: ${{ matrix.os }} | |
needs: create_staging_repository | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-22.04, macos-13, macos-14] #, windows-latest] | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: apt update (on Linux) | |
if: matrix.os == 'ubuntu-22.04' | |
run: | | |
sudo apt-get update | |
echo y | sudo apt-get install doxygen cmake ninja-build libasound2-dev libjack-jackd2-dev | |
- name: setup Windows developer tools for C++ | |
if: matrix.os == 'windows-latest' | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
# Only for release tags | |
- name: setup gpg necessities | |
if: startsWith(github.ref, 'refs/tags/') | |
shell: bash | |
run: | | |
mkdir -p '${{ github.workspace }}' | |
echo '${{ secrets.GPG_KEY_CONTENTS }}' | base64 -d > '${{ github.workspace }}/${{ secrets.SIGNING_SECRET_KEY_RING_FILE }}' | |
- name: setup gpg necessities on Windows | |
if: false #startsWith(github.ref, 'refs/tags/') && startsWith(matrix.os, 'windows') | |
run: | | |
[System.Text.Encoding]::Unicode.GetString([System.Convert]::FromBase64String("${{ secrets.GPG_KEY_CONTENTS }}")) | Out-File '${{ env.WORKSPACE }}/${{ secrets.SIGNING_SECRET_KEY_RING_FILE }}' | |
env: | |
WORKSPACE: ${{ github.workspace }} | |
GPG_KEY_CONTENTS: ${{ secrets.GPG_KEY_CONTENTS }} | |
SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }} | |
- name: rewrite build.gradle to require signing on awkward OS | |
if: startsWith(github.ref, 'refs/tags/') && contains(matrix.os, 'macos') | |
run: sed -i "" "s/signing {}/signing { sign(publishing.publications) }/" rtmidi-javacpp/build.gradle | |
- name: rewrite build.gradle to require signing on standard OS | |
shell: bash | |
if: startsWith(github.ref, 'refs/tags/') && !contains(matrix.os, 'macos') | |
run: sed -i "s/signing {}/signing { sign(publishing.publications) }/" rtmidi-javacpp/build.gradle | |
# build or publish, depending on whether it is for release tags or not | |
- name: build (ONLY FOR NON-RELEASES) | |
if: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
run: ./gradlew --warning-mode all build | |
- name: publish (ONLY FOR NEW RELEASE TAGS) | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | |
./gradlew --warning-mode all build publish | |
env: | |
OSSRH_USERNAME: atsushieno | |
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
OSSRH_STAGING_REPOSITORY_ID: ${{ needs.create_staging_repository.outputs.repository_id }} | |
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} | |
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | |
SIGNING_SECRET_KEY_RING_FILE: ${{ format('{0}/{1}', github.workspace, secrets.SIGNING_SECRET_KEY_RING_FILE) }} | |
- name: upload artifact - Jar | |
if: success() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: rtmidi-javacpp-jars | |
path: rtmidi-javacpp/build/libs/*.jar | |
# Update API reference, | |
- name: deploy to GitHub Pages | |
# FIXME: enable it again once it's working again | |
if: false # success() && startsWith(github.ref, 'refs/tags/') && startsWith(matrix.os, 'ubuntu') | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: gh-pages | |
folder: rtmidi-javacpp/build/docs/javadoc |