update GitHub Actions setup. #327
Workflow file for this run
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 dist | |
on: | |
push: | |
pull_request: | |
jobs: | |
linux-build: | |
name: build on linux | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
# 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: rewrite build.gradle to require signing on awkward OS | |
if: startsWith(github.ref, 'refs/tags/') && startsWith(matrix.os, 'macos') | |
run: | | |
sed -i "" "s/signing {}/signing { sign(publishing.publications) }/" */build.gradle* | |
- name: rewrite build.gradle to require signing on standard OS | |
shell: bash | |
if: startsWith(github.ref, 'refs/tags/') && !startsWith(matrix.os, 'macos') | |
run: | | |
sed -i "s/signing {}/signing { sign(publishing.publications) }/" */build.gradle* | |
- name: apt update | |
run: | | |
sudo apt-get update | |
- name: set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: temurin | |
- name: apt install | |
run: | | |
echo y | sudo apt-get install doxygen cmake ninja-build libasound2-dev libjack-jackd2-0 | |
- name: build RtMidi for Kotlin/Native | |
run: ./build-rtmidi.sh | |
- name: build with Gradle (only for non-releases) | |
if: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
run: ./gradlew --warning-mode all build | |
- name: publish with Gradle (only for releases) | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
run: ./gradlew --warning-mode all publish | |
env: | |
OSSRH_USERNAME: atsushieno | |
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
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 build failure logs | |
if: failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: test-failure-logs | |
path: | | |
ktmidi/build/reports/ | |
ktmidi-jvm-desktop/build/reports/ | |
ktmidi/*.log | |
ktmidi-native-ext/*.log | |
ktmidi-jvm-desktop/*.log | |
- name: upload artifact | |
if: success() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ktmidi-artifacts | |
path: | | |
ktmidi/build/libs/*.jar | |
ktmidi/build/outputs/aar/*.aar | |
ktmidi-native-ext/build/bin | |
ktmidi-jvm-desktop/build/libs/*.jar | |
- name: deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
publish_branch: gh-pages | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ktmidi/build/dokka/html |