-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (112 loc) · 4.64 KB
/
Copy pathpublish.yml
File metadata and controls
135 lines (112 loc) · 4.64 KB
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
name: Publish to GitHub Packages
permissions:
contents: write
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tagName:
description: 'Tag-name to publish - compound version (e.g., v4.4.1-0.0.1)'
required: true
default: 'v4.4.1-0.0.1'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Extract version from tag or input
id: version
run: |
TAG_NAME="${GITHUB_REF#refs/tags/}"
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
TAG_NAME="${{ github.event.inputs.tagName }}"
fi
# Expected formats:
# vX.Y.Z-A.B.C (e.g., v4.4.1-0.0.9)
# vX.Y-A.B.C (e.g., v4.5-0.0.9)
# v3.x-A.B.C (e.g., v3.x-0.0.16)
# X.Y(.Z|.x) = Godot version
# A.B.C = package version
if [[ ! "$TAG_NAME" =~ ^v[0-9]+(\.[0-9]+|\.x)(\.[0-9]+)?-[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Tag name '$TAG_NAME' does not match required formats: vX.Y.Z-A.B.C, vX.Y-A.B.C, or v3.x-A.B.C"
exit 1
fi
VERSION="${TAG_NAME#v}" # remove leading 'v'
GODOT_VERSION="${VERSION%%-*}" # extract before the '-'
PACKAGE_VERSION="${VERSION#*-}" # extract after the '-'
echo "Full Version: $VERSION"
echo "Godot Version: $GODOT_VERSION"
echo "Package Version: $PACKAGE_VERSION"
# Export for later steps
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "godotVersion=$GODOT_VERSION" >> $GITHUB_OUTPUT
echo "packageVersion=$PACKAGE_VERSION" >> $GITHUB_OUTPUT
echo "dashedGodotVersion=${GODOT_VERSION//./-}" >> $GITHUB_OUTPUT
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y p7zip-full rsync curl jq build-essential pkg-config libx11-dev libxcursor-dev libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libdbus-1-dev libudev-dev libxi-dev libxrandr-dev yasm xvfb wget unzip libspeechd-dev speech-dispatcher python3 python3-pip
pip3 install --user scons
- name: Build AAR
run: |
chmod +x build-aar.sh
./build-aar.sh "${{ steps.version.outputs.godotVersion }}"
- name: Verify AAR exists
run: |
if [ ! -f "godot-${{ steps.version.outputs.godotVersion }}/bin/godot-lib.template_release.aar" ]; then
echo "AAR file not found!"
exit 1
fi
ls -la godot-${{ steps.version.outputs.godotVersion }}/bin/
- name: Publish to GitHub Packages
env:
GITHUB_TOKEN: ${{ secrets.PACKAGE_TOKEN }}
run: |
./gradlew publish -Pversion="${{ steps.version.outputs.packageVersion }}" -PgodotVersion="${{ steps.version.outputs.godotVersion }}"
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ steps.version.outputs.version }}
body: |
## Godot Android Library ${{ steps.version.outputs.godotVersion }} - ${{ steps.version.outputs.packageVersion }}
This release includes the patched Godot Android library with filesystem-based asset access.
### Usage
Add to your `build.gradle`:
```gradle
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/shipth-is/godroid-builder")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
}
dependencies {
implementation 'shipth.is:godot-lib-v${{ steps.version.outputs.dashedGodotVersion }}:${{ steps.version.outputs.packageVersion }}:template-release@aar'
}
```
draft: false
prerelease: false