Skip to content

Commit c8e4858

Browse files
committed
feat: CI and packaging
1 parent 6cd7b8b commit c8e4858

File tree

5 files changed

+126
-1
lines changed

5 files changed

+126
-1
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
2+
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
3+
4+
name: Gradle Package
5+
6+
on:
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Set up JDK 8
21+
uses: actions/setup-java@v4
22+
with:
23+
java-version: '8'
24+
distribution: 'temurin'
25+
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
26+
settings-path: ${{ github.workspace }} # location for the settings.xml file
27+
28+
- name: Setup Gradle
29+
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
30+
31+
- name: Build with Gradle
32+
run: ./gradlew :desktop:distTar
33+
34+
- uses: googleapis/release-please-action@v4
35+
with:
36+
token: ${{ secrets.GITHUB_TOKEN }}
37+
release-type: simple
38+
39+
- name: Upload Release
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
run:
43+
gh release upload ${{ steps.release.outputs.tag_name }} desktop/build/distributions/desktop.tar
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
10+
name: release-please
11+
12+
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: googleapis/release-please-action@v4
17+
with:
18+
token: ${{ secrets.GITHUB_TOKEN }}
19+
release-type: simple

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
project.description = 'GeoGebra'
1+
project.description = 'GeoGeobra'
22

33
apply from: 'gradle-scripts/dependencies.gradle'
44

pkg/PKGBUILD

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Maintainer: Mustafa <dev at mstfelg dot com>
2+
3+
pkgname=gsq
4+
pkgdesc="Geogebra-fork focused on extensibility and support for Euclidean Geometry."
5+
pkgver=1.0.0
6+
pkgrel=1
7+
arch=('x86_64') # Adjust according to your package's architecture
8+
url="https://github.com/mstfelg/geosquared"
9+
license=('GPL3' 'CCPL:by-sa' 'CCPL:by-nc') # Adjust the license according to the project
10+
depends=(
11+
'hicolor-icon-theme'
12+
'java-runtime=11'
13+
'xdg-utils'
14+
)
15+
source=("https://github.com/mstfelg/geosquared/archive/refs/tags/v${pkgver}.tar.gz")
16+
sha256sums=('ad044a1baae54f4a6caa9aa3c62402b4627024030a12a2ab97b6201c30d5db59')
17+
18+
package() {
19+
cd "${srcdir}/desktop" || return
20+
install -Dm755 "${srcdir}/bin/desktop" "${pkgdir}/usr/bin/gsq"
21+
install -dm755 "${pkgdir}/usr/share/gsq"
22+
install "lib/"* -t "${pkgdir}/usr/share/gsq/"
23+
}
24+
25+
# Additional functions can be added here if needed

pkg/gsq

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/sh
2+
GG_PATH="/usr/share"
3+
export GG_CONFIG_PATH="${HOME}"
4+
GG_EXECUTABLE="${GG_PATH}/gsq/gsq"
5+
GG_JAVA_VERSION="11"
6+
7+
run_gg() {
8+
exec "${GG_EXECUTABLE}" "$@"
9+
exit 0
10+
}
11+
12+
# check JAVA_HOME first
13+
if test ! -z "${JAVA_HOME}"; then
14+
if test "${JAVA_HOME#*$GG_JAVA_VERSION}" != "${JAVA_HOME}"; then
15+
# system environment variable set to required, do nothing
16+
echo "Using java environment from JAVA_HOME: ${JAVA_HOME}" >&2
17+
run_gg "$@"
18+
else
19+
# unset JAVA_HOME
20+
echo "Unset JAVA_HOME for this run: ${JAVA_HOME}" >&2
21+
unset JAVA_HOME
22+
fi
23+
fi
24+
25+
# check current environment
26+
if archlinux-java status | grep "default" | grep -qw "${GG_JAVA_VERSION}"; then
27+
# required java version is set to default, do nothing
28+
echo "Using system enabled java environment" >&2
29+
run_gg "$@"
30+
fi
31+
32+
# find valid environment
33+
GG_JAVA_ENV="$(archlinux-java status | grep -w "${GG_JAVA_VERSION}" | awk '{ print $1 }')"
34+
# for some env it returns like java-8-openjdk/jre
35+
GG_JAVA_ENV="${GG_JAVA_ENV%/*}"
36+
export PATH="/usr/lib/jvm/${GG_JAVA_ENV}/bin/:${PATH}"
37+
echo "Run with exported ${GG_JAVA_ENV}" >&2
38+
run_gg "$@"

0 commit comments

Comments
 (0)