Skip to content

Commit a95657d

Browse files
committed
Add workflow for automatic release creation
1 parent a54d857 commit a95657d

File tree

5 files changed

+283
-0
lines changed

5 files changed

+283
-0
lines changed
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
name: release-on-tag
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
name: Build - ${{ matrix.target }}
12+
runs-on: ${{ matrix.runner }}
13+
strategy:
14+
matrix:
15+
include:
16+
- runner: ubuntu-latest
17+
target: x86_64-unknown-linux-gnu
18+
bin: libgodot_mcap.so
19+
final_name: godot_mcap.so
20+
21+
- runner: windows-latest
22+
target: x86_64-pc-windows-msvc
23+
bin: godot_mcap.dll
24+
final_name: godot_mcap.dll
25+
26+
- runner: macos-latest
27+
target: x86_64-apple-darwin
28+
bin: libgodot_mcap.dylib
29+
final_name: godot_mcap_x64.dylib
30+
31+
- runner: macos-latest
32+
target: aarch64-apple-darwin
33+
bin: libgodot_mcap.dylib
34+
final_name: godot_mcap_arm.dylib
35+
36+
- runner: ubuntu-latest
37+
target: aarch64-linux-android
38+
bin: libgodot_mcap.so
39+
final_name: libgodot_mcap_arm64.so
40+
41+
- runner: ubuntu-latest
42+
target: armv7-linux-androideabi
43+
bin: libgodot_mcap.so
44+
final_name: libgodot_mcap_armv7.so
45+
46+
steps:
47+
- uses: actions/checkout@v4
48+
- name: Install Rust
49+
uses: dtolnay/rust-toolchain@stable
50+
with:
51+
targets: ${{ matrix.target }}
52+
53+
- name: Install cargo-ndk
54+
if: startsWith(matrix.target, 'aarch64-linux-android') || startsWith(matrix.target, 'armv7-linux-androideabi')
55+
run: |
56+
cargo install cargo-ndk
57+
rustup target add aarch64-linux-android armv7-linux-androideabi
58+
rustup target install aarch64-linux-android armv7-linux-androideabi
59+
60+
- name: Setup Android NDK
61+
if: startsWith(matrix.target, 'aarch64-linux-android') || startsWith(matrix.target, 'armv7-linux-androideabi')
62+
uses: nttld/[email protected]
63+
with:
64+
ndk-version: r27c
65+
66+
- name: Setup Java JDK
67+
if: startsWith(matrix.target, 'aarch64-linux-android') || startsWith(matrix.target, 'armv7-linux-androideabi')
68+
uses: actions/[email protected]
69+
with:
70+
java-version: 17
71+
distribution: temurin
72+
java-package: jdk
73+
74+
- name: Build rust binary
75+
if: startsWith(matrix.target, 'x86_64-unknown-linux-gnu') || startsWith(matrix.target, 'x86_64-pc-windows-msvc') || startsWith(matrix.target, 'x86_64-apple-darwin') || startsWith(matrix.target, 'aarch64-apple-darwin')
76+
run: cargo build --verbose --locked --release --target ${{ matrix.target }}
77+
78+
- name: Build rust binary for android
79+
if: startsWith(matrix.target, 'aarch64-linux-android') || startsWith(matrix.target, 'armv7-linux-androideabi')
80+
run: cargo ndk -t ${{ matrix.target }} build --release --verbose
81+
82+
- name: Rename to final_name
83+
run: mv target/${{ matrix.target }}/release/${{ matrix.bin }} target/${{ matrix.target }}/release/${{ matrix.final_name }}
84+
85+
- name: Upload artifact
86+
uses: actions/upload-artifact@v4
87+
with:
88+
name: ${{ matrix.final_name }}
89+
path: target/${{ matrix.target }}/release/${{ matrix.final_name }}
90+
91+
package:
92+
runs-on: macos-latest
93+
needs: build
94+
steps:
95+
- uses: actions/checkout@v4
96+
97+
- name: Download all binaries into addons/godot_mcap
98+
uses: actions/download-artifact@v4
99+
with:
100+
path: addons/godot_mcap
101+
merge-multiple: true
102+
103+
# Make a universal macOS dylib from the two arch builds
104+
- name: Build macOS universal dylib
105+
run: |
106+
lipo -create \
107+
-output addons/godot_mcap/godot_mcap.dylib \
108+
addons/godot_mcap/godot_mcap_x64.dylib \
109+
addons/godot_mcap/godot_mcap_arm.dylib
110+
rm addons/godot_mcap/godot_mcap_x64.dylib addons/godot_mcap/godot_mcap_arm.dylib
111+
112+
- name: Generate third party notices
113+
run: |
114+
cargo install cargo-about --locked
115+
cargo about generate about.hbs > addons/godot_mcap/LICENSE_NOTICES.html
116+
117+
- name: Zip addon folder
118+
run: |
119+
zip -r godot_mcap.zip addons
120+
121+
- name: Upload package
122+
uses: actions/upload-artifact@v4
123+
with:
124+
name: package
125+
path: godot_mcap.zip
126+
127+
release:
128+
runs-on: ubuntu-latest
129+
needs: package
130+
if: startsWith(github.ref, 'refs/tags/v')
131+
permissions:
132+
contents: write
133+
steps:
134+
- name: Download package
135+
uses: actions/download-artifact@v4
136+
with:
137+
name: package
138+
path: .
139+
140+
- name: Create draft release
141+
uses: softprops/action-gh-release@v1
142+
with:
143+
tag_name: ${{ github.ref_name }}
144+
draft: true
145+
generate_release_notes: true
146+
files: godot_mcap.zip

about.hbs

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<html>
2+
3+
<head>
4+
<style>
5+
@media (prefers-color-scheme: dark) {
6+
body {
7+
background: #333;
8+
color: white;
9+
}
10+
a {
11+
color: skyblue;
12+
}
13+
}
14+
.container {
15+
font-family: sans-serif;
16+
max-width: 800px;
17+
margin: 0 auto;
18+
}
19+
.intro {
20+
text-align: center;
21+
}
22+
.licenses-list {
23+
list-style-type: none;
24+
margin: 0;
25+
padding: 0;
26+
}
27+
.license-used-by {
28+
margin-top: -10px;
29+
}
30+
.license-text {
31+
max-height: 200px;
32+
overflow-y: scroll;
33+
white-space: pre-wrap;
34+
}
35+
</style>
36+
</head>
37+
38+
<body>
39+
<main class="container">
40+
<div class="intro">
41+
<h1>Third Party Licenses</h1>
42+
<p>This page lists the licenses of the projects used in godot-mcap.</p>
43+
</div>
44+
45+
<h2>Overview of licenses:</h2>
46+
<ul class="licenses-overview">
47+
{{#each overview}}
48+
<li><a href="#{{id}}">{{name}}</a> ({{count}})</li>
49+
{{/each}}
50+
</ul>
51+
52+
<h2>All license text:</h2>
53+
<ul class="licenses-list">
54+
{{#each licenses}}
55+
<li class="license">
56+
<h3 id="{{id}}">{{name}}</h3>
57+
<h4>Used by:</h4>
58+
<ul class="license-used-by">
59+
{{#each used_by}}
60+
<li><a href="{{#if crate.repository}} {{crate.repository}} {{else}} https://crates.io/crates/{{crate.name}} {{/if}}">{{crate.name}} {{crate.version}}</a></li>
61+
{{/each}}
62+
</ul>
63+
<pre class="license-text">{{text}}</pre>
64+
</li>
65+
{{/each}}
66+
</ul>
67+
</main>
68+
</body>
69+
70+
</html>

about.toml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
accepted = [
2+
"Apache-2.0",
3+
"MIT",
4+
"MPL-2.0",
5+
]
6+
ignore-build-dependencies = true
7+
ignore-dev-dependencies = true
8+
9+
[unicode-ident]
10+
accepted = [
11+
"Unicode-3.0"
12+
]
13+
14+
[zstd-sys]
15+
accepted = [
16+
"MIT",
17+
"Apache-2.0",
18+
"BSD-3-Clause",
19+
]
20+
[zstd-sys.clarify]
21+
license = "(MIT OR Apache-2.0) AND BSD-3-Clause"
22+
[[zstd-sys.clarify.files]]
23+
path = "LICENSE.Mit"
24+
license = "MIT"
25+
checksum = '129e8edef29e9abcd2ebabe252f4ef1b1289cdca356bf0040284a2fbccfb96c8'
26+
[[zstd-sys.clarify.files]]
27+
path = "LICENSE.Apache-2.0"
28+
license = "Apache-2.0"
29+
checksum = '0d542e0c8804e39aa7f37eb00da5a762149dc682d7829451287e11b938e94594'
30+
[[zstd-sys.clarify.files]]
31+
path = "LICENSE.BSD-3-Clause"
32+
license = "BSD-3-Clause"
33+
checksum = '48341f685c87304089aa099b23c386f8bacc519ef555aa7a13e239908907b3fd'
34+
35+
[lz4-sys]
36+
accepted = [
37+
"MIT",
38+
"BSD-2-Clause",
39+
]
40+
[lz4-sys.clarify]
41+
license = "MIT AND BSD-2-Clause"
42+
[[lz4-sys.clarify.files]]
43+
path = "LICENSE"
44+
license = "MIT"
45+
checksum = '77633124ac69bf094e06cf9f3157c54d6e51d6b58a38d4f28141947815ecadfa'
46+
[[lz4-sys.clarify.files]]
47+
path = "liblz4/lib/LICENSE"
48+
license = "BSD-2-Clause"
49+
checksum = '8b58c446121a109ccf32edc094bba3010a3d85e4ee3702950db55e4d3e87736c'
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[configuration]
2+
entry_symbol = "gdext_rust_init"
3+
compatibility_minimum = 4.1
4+
reloadable = true
5+
6+
[libraries]
7+
linux.debug.x86_64 = "res://addons/godot_mcap/godot_mcap.so"
8+
linux.release.x86_64 = "res://addons/godot_mcap/godot_mcap.so"
9+
windows.debug.x86_64 = "res://addons/godot_mcap/godot_mcap.dll"
10+
windows.release.x86_64 = "res://addons/godot_mcap/godot_mcap.dll"
11+
macos.debug = "res://addons/godot_mcap/godot_mcap.dylib"
12+
macos.release = "res://addons/godot_mcap/godot_mcap.dylib"
13+
android.debug.arm64 = "res://addons/godot_mcap/libgodot_mcap_arm64.so"
14+
android.release.arm64 = "res://addons/godot_mcap/libgodot_mcap_arm64.so"
15+
android.debug.arm32 = "res://addons/godot_mcap/libgodot_mcap_armv7.so"
16+
android.release.arm32 = "res://addons/godot_mcap/libgodot_mcap_armv7.so"

addons/godot_mcap/icon.svg

Lines changed: 2 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)