-
Notifications
You must be signed in to change notification settings - Fork 7
153 lines (145 loc) · 6.92 KB
/
actions.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: build dist
on:
push:
pull_request:
workflow_dispatch:
jobs:
create_staging_repository:
runs-on: ubuntu-22.04
if: false
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: ${{ secrets.OSSRH_USERNAME }}
password: ${{ secrets.OSSRH_PASSWORD }}
staging_profile_id: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
description: ${{ github.repository }}/${{ github.workflow }}#${{ github.run_number }}
base_url: https://s01.oss.sonatype.org/service/local/
build:
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]
steps:
- name: checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: setup apt packages 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-0
- name: set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
# 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/') && contains(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/') && !contains(matrix.os, 'macos')
run: |
sed -i "s/signing {}/signing { sign(publishing.publications) }/" */build.gradle*
- name: build RtMidi for Kotlin/Native
run: ./build-rtmidi.sh
# Workaround rtmidi-javacpp reference resolution failure issue
- name: build and publishToMavenLocal rtmidi-javacpp (just for local platform is fine)
run: cd external/rtmidi-javacpp && ./gradlew --no-daemon build publishToMavenLocal; cd ../..
# only for NON-releases on macos-13
- name: macos-13 lightweight build with Gradle for libs
if: ${{ !startsWith(github.ref, 'refs/tags/') && contains(matrix.os, 'macos-13') }}
run: ./gradlew --warning-mode all publishToMavenLocal
# only for releases on macos-13
- name: macos-13 lightweight publish with Gradle for libs
if: ${{ startsWith(github.ref, 'refs/tags/') && contains(matrix.os, 'macos-13') }}
run: ./gradlew --no-daemon --warning-mode all publishMacosX64PublicationToOSSRHRepository publishIosX64PublicationToOSSRHRepository
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
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) }}
# only for NON-releases on macos-14
- name: macos-14 lightweight build with Gradle for libs and apps
if: ${{ !startsWith(github.ref, 'refs/tags/') && contains(matrix.os, 'macos-14') }}
run: ./gradlew --warning-mode all publishToMavenLocal iosArm64Binaries
# only for releases on macos-14
- name: macos-14 lightweight publish with Gradle for libs and apps
if: ${{ startsWith(github.ref, 'refs/tags/') && contains(matrix.os, 'macos-14') }}
run: ./gradlew --no-daemon --warning-mode all iosArm64Binaries packageDmg publishMacosArm64PublicationToOSSRHRepository PublishIosArm64PublicationToOSSRHRepository PublishIosSimulatorArm64PublicationToOSSRHRepository
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
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) }}
# only for NON-releases on Linux
- name: linux build with Gradle
if: ${{ !startsWith(github.ref, 'refs/tags/') && contains(matrix.os, 'ubuntu-22.04') }}
run: ./gradlew --warning-mode all build
# only for releases on Linux
- name: linux publish with Gradle
if: ${{ startsWith(github.ref, 'refs/tags/') && contains(matrix.os, 'ubuntu-22.04') }}
run: ./gradlew --no-daemon --warning-mode all dokkaHtml publish
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
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 build failure logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-failure-logs-${{ matrix.os }}
path: |
ktmidi/build/reports/
ktmidi-jvm-desktop/build/reports/
ktmidi/*.log
ktmidi-ci/*.log
ktmidi-native-ext/*.log
ktmidi-jvm-desktop/*.log
- name: upload artifact
if: success()
uses: actions/upload-artifact@v4
with:
name: ktmidi-artifacts-${{ matrix.os }}
path: |
ktmidi/build/libs/*.jar
ktmidi/build/outputs/aar/*.aar
ktmidi-ci/build/libs/*.jar
ktmidi-ci/build/outputs/aar/*.aar
ktmidi-native-ext/build/bin
ktmidi-jvm-desktop/build/libs/*.jar
ktmidi-ci-tool/build/bin/iosArm64
ktmidi-ci-tool/build/compose/binaries/main/dmg
# only for releases
- name: deploy to GitHub Pages
if: ${{ startsWith(github.ref, 'refs/tags/') && startsWith(matrix.os, 'ubuntu') }}
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: ktmidi/build/dokka/html