-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (138 loc) · 5.52 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
name: 'build'
on:
push:
pull_request:
workflow_dispatch:
jobs:
build_native:
name: 'build native library on ${{ matrix.os }}'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, ubuntu-24.04-arm, macos-13, macos-14, windows-latest]
steps:
- name: checkout
uses: actions/checkout@v4
with:
submodules: true
- name: apt update (on Linux)
if: startsWith(matrix.os, 'ubuntu')
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: startsWith(matrix.os, 'windows')
uses: ilammy/msvc-dev-cmd@v1
- name: build libremidi on non-Windows platforms
shell: bash
if: ${{ !startsWith(matrix.os, 'windows') }}
run: |
cd external/libremidi
cmake -B cmake-build-relwithdebinfo -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=On
cmake --build cmake-build-relwithdebinfo
- name: build libremidi on Windows
shell: bash
if: startsWith(matrix.os, 'windows')
run: |
cd external/libremidi
cmake -B cmake-build-relwithdebinfo -DBUILD_SHARED_LIBS=On
cmake --build cmake-build-relwithdebinfo --config=Release
- name: upload libremidi on ${{matrix.os}}
if: startsWith(matrix.os, 'macos')
uses: actions/upload-artifact@v4
with:
name: libremidi-bin-${{matrix.os}}
path: external/libremidi/cmake-build-relwithdebinfo/liblibremidi.dylib
- name: upload libremidi on ${{matrix.os}}
if: startsWith(matrix.os, 'ubuntu')
uses: actions/upload-artifact@v4
with:
name: libremidi-bin-${{matrix.os}}
path: external/libremidi/cmake-build-relwithdebinfo/liblibremidi.so
- name: upload libremidi on ${{matrix.os}}
if: startsWith(matrix.os, 'windows')
uses: actions/upload-artifact@v4
with:
name: libremidi-bin-${{matrix.os}}
path: external/libremidi/cmake-build-relwithdebinfo/Release/libremidi.dll
build-publish-jar:
name: 'build and publish jar'
needs: build_native
runs-on: ubuntu-24.04
steps:
# Do I need to check out the repo TWICE!?
- name: checkout
uses: actions/checkout@v4
with:
submodules: true
# get native build outcomes from all the target lanes
- name: download libremidi on Darwin-x64
uses: actions/download-artifact@v4
with:
name: libremidi-bin-macos-13
path: libremidi-panama/src/main/resources/jne/macos/x64/
- name: download libremidi on Darwin-arm64
uses: actions/download-artifact@v4
with:
name: libremidi-bin-macos-14
path: libremidi-panama/src/main/resources/jne/macos/arm64/
- name: download libremidi on Linux-x64
uses: actions/download-artifact@v4
with:
name: libremidi-bin-ubuntu-24.04
path: libremidi-panama/src/main/resources/jne/linux/x64/
- name: download libremidi on Linux-arm64
uses: actions/download-artifact@v4
with:
name: libremidi-bin-ubuntu-24.04-arm
path: libremidi-panama/src/main/resources/jne/linux/arm64/
- name: download libremidi on Windows-x64
uses: actions/download-artifact@v4
with:
name: libremidi-bin-windows-latest
path: libremidi-panama/src/main/resources/jne/windows/x64/
- name: set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '22'
# 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
shell: bash
if: startsWith(github.ref, 'refs/tags/')
run: sed -i "s/signing {}/signing { sign(publishing.publications) }/" libremidi-panama/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: |
cd ${{ github.workspace }} && ./gradlew --warning-mode all build
- name: publish (ONLY FOR NEW RELEASE TAGS)
if: startsWith(github.ref, 'refs/tags/')
run: |
cd ${{ github.workspace }} && ./gradlew --warning-mode all build publish
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
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 artifact - Jar
if: success()
uses: actions/upload-artifact@v4
with:
name: libremidi-panama-jars
path: libremidi-panama/build/libs/*.jar
# Update API reference,
- name: deploy to GitHub Pages
if: success() && startsWith(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-24.04'
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: libremidi-panama/build/docs/javadoc