Skip to content

Commit a6b5d18

Browse files
authored
Merge pull request #43 from Lessica/copilot/update-release-naming-convention
chore: switch version source from git tag to control file Version field
2 parents 7a3ca99 + 76d317e commit a6b5d18

4 files changed

Lines changed: 25 additions & 42 deletions

File tree

.github/workflows/build-release.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99

1010
env:
1111
THEOS: ''
12-
GIT_TAG: ''
12+
PKG_VERSION: ''
1313
XCODE_VERSION: '15.4'
1414

1515
jobs:
@@ -60,27 +60,26 @@ jobs:
6060
echo "Available SDKs: $(find $THEOS/sdks -name "*.sdk" -maxdepth 1 -print)"
6161
echo "FINALPACKAGE=1" >> $GITHUB_ENV
6262
cd $GITHUB_WORKSPACE/TrollSpeed
63-
git fetch --tags
64-
echo "GIT_TAG=$(git describe --tags --always --abbrev=0)" >> $GITHUB_ENV
63+
echo "PKG_VERSION=$(./get-version.sh)" >> $GITHUB_ENV
6564
6665
- name: Build package
6766
run: |
6867
cd $GITHUB_WORKSPACE/TrollSpeed
69-
./gen-control.sh ${{ env.GIT_TAG }}
70-
./build.sh ${{ env.GIT_TAG }}
68+
./gen-control.sh
69+
./build.sh
7170
THEOS_PACKAGE_SCHEME=roothide FINALPACKAGE=1 gmake clean package
7271
THEOS_PACKAGE_SCHEME=rootless FINALPACKAGE=1 gmake clean package
7372
FINALPACKAGE=1 gmake clean package
7473
7574
- name: Collect symbols
7675
run: |
7776
cd $GITHUB_WORKSPACE/TrollSpeed
78-
find .theos/obj -name "*.dSYM" -print | zip -r packages/TrollSpeed_${{ env.GIT_TAG }}_symbols.zip -@
77+
find .theos/obj -name "*.dSYM" -print | zip -r packages/TrollSpeed_${{ env.PKG_VERSION }}_symbols.zip -@
7978
8079
- name: Upload artifacts
8180
uses: actions/upload-artifact@v4
8281
with:
83-
name: TrollSpeed_${{ env.GIT_TAG }}
82+
name: TrollSpeed_${{ env.PKG_VERSION }}
8483
path: |
8584
TrollSpeed/packages/TrollSpeed_*.tipa
8685
TrollSpeed/packages/TrollSpeed+AppIntents16_*.tipa
@@ -89,9 +88,9 @@ jobs:
8988
- name: Upload symbols
9089
uses: actions/upload-artifact@v4
9190
with:
92-
name: TrollSpeed_${{ env.GIT_TAG }}_symbols
91+
name: TrollSpeed_${{ env.PKG_VERSION }}_symbols
9392
path: |
94-
TrollSpeed/packages/TrollSpeed_${{ env.GIT_TAG }}_symbols.zip
93+
TrollSpeed/packages/TrollSpeed_${{ env.PKG_VERSION }}_symbols.zip
9594
9695
- name: Upload release
9796
uses: softprops/action-gh-release@v1

build.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
#!/bin/sh
22

33
# This script is used to build the TrollSpeed app and create a tipa file with Xcode.
4-
if [ $# -ne 1 ]; then
5-
echo "Usage: $0 <version>"
6-
exit 1
7-
fi
84

9-
VERSION=$1
5+
# Read the version from the existing control file
6+
VERSION=$(./get-version.sh) || exit 1
107

11-
# Strip leading "v" from version if present
12-
VERSION=${VERSION#v}
8+
echo "Using version: $VERSION"
139

1410
# Set GITHUB_WORKSPACE to home directory if not set
1511
if [ -z "$GITHUB_WORKSPACE" ]; then

gen-control.sh

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,11 @@
11
#!/bin/sh
22

33
# This script is used to generate the control file for the Debian package.
4-
if [ $# -ne 1 ]; then
5-
echo "Usage: $0 <version>"
6-
exit 1
7-
fi
84

9-
VERSION=$1
5+
# Read the version from the existing control file
6+
VERSION=$(./get-version.sh) || exit 1
107

11-
# Strip leading "v" from version if present
12-
VERSION=${VERSION#v}
13-
14-
# Create the layout directory
15-
mkdir -p layout/DEBIAN
16-
17-
# Write the control file
18-
cat > layout/DEBIAN/control << __EOF__
19-
Package: ch.xxtou.hudapp.jb
20-
Name: TrollSpeed JB
21-
Version: $VERSION
22-
Section: Tweaks
23-
Depends: firmware (>= 14.0)
24-
Architecture: iphoneos-arm
25-
Author: Lessica <82flex@gmail.com>
26-
Maintainer: Lessica <82flex@gmail.com>
27-
Description: Troll your speed, but jailbroken.
28-
__EOF__
29-
30-
# Set permissions
31-
chmod 0644 layout/DEBIAN/control
8+
echo "Using version: $VERSION"
329

3310
RAND_BUILD_STR=$(openssl rand -hex 4)
3411

get-version.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
# This script reads the package version from layout/DEBIAN/control.
4+
VERSION=$(grep -m1 '^Version:' layout/DEBIAN/control | awk '{print $2}' | tr -d '[:space:]')
5+
6+
if [ -z "$VERSION" ]; then
7+
echo "Error: Could not read Version from layout/DEBIAN/control" >&2
8+
exit 1
9+
fi
10+
11+
echo "$VERSION"

0 commit comments

Comments
 (0)