Skip to content

Check for the correct files #54

Check for the correct files

Check for the correct files #54

Workflow file for this run

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