Skip to content

Commit e745f68

Browse files
authored
Merge pull request #157 from alexballas/devel
v2.5.0
2 parents bbfb7c9 + eac8f79 commit e745f68

197 files changed

Lines changed: 36964 additions & 1769 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-android.yml

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,46 @@ jobs:
1515

1616
- uses: actions/setup-go@v6
1717
with:
18-
go-version: 'stable'
18+
go-version-file: go.mod
1919

20-
- name: Install fyne
21-
run: go install github.com/alexballas/refyne/v2/cmd/fyne@latest
20+
# No "install fyne" step: `make android` provisions the packaging CLI itself,
21+
# at the refyne version go.mod pins. Installing @latest here resolved to the
22+
# newest release tag, which is older than the commit the app compiles against,
23+
# so the APK would ship without the Java that backs the share target.
2224

2325
- name: Download Android SDK
2426
run: |
2527
wget https://dl.google.com/android/repository/android-ndk-r27d-linux.zip
2628
unzip android-ndk-r27d-linux.zip
2729
2830
- name: Package (Android)
31+
env:
32+
# Without a persistent key `make android` mints a throwaway one per run,
33+
# and Android refuses to install a build over one signed by a different
34+
# key. Unset on forks, where secrets are unavailable; those builds are
35+
# still useful for testing, they just cannot upgrade an install.
36+
ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
37+
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
38+
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
39+
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
2940
run: |
3041
# Resolve the absolute path for the NDK
3142
APATH=$(readlink -f android-ndk-r27d)
3243
33-
# Keep Go code version parity with app-version.
34-
sed -i "s/version = \"dev\"/version = \"$(echo ${{ env.GO2TV_VERSION }} | sed 's/^v//')\"/" cmd/go2tv/go2tv.go
44+
if [ -n "$ANDROID_KEYSTORE_BASE64" ]; then
45+
if [ -z "$ANDROID_KEYSTORE_PASSWORD" ]; then
46+
echo "ANDROID_KEYSTORE_BASE64 is set but ANDROID_KEYSTORE_PASSWORD is not"
47+
exit 1
48+
fi
49+
# RUNNER_TEMP is outside the workspace, so the key cannot reach an artifact.
50+
export GO2TV_ANDROID_KEYSTORE="$RUNNER_TEMP/release.keystore"
51+
printf '%s' "$ANDROID_KEYSTORE_BASE64" | tr -d '\n\r' | base64 -d > "$GO2TV_ANDROID_KEYSTORE"
52+
export GO2TV_ANDROID_KEYSTORE_PASS="$ANDROID_KEYSTORE_PASSWORD"
53+
export GO2TV_ANDROID_KEY_ALIAS="${ANDROID_KEY_ALIAS:-go2tv}"
54+
export GO2TV_ANDROID_KEY_PASS="${ANDROID_KEY_PASSWORD:-$ANDROID_KEYSTORE_PASSWORD}"
55+
else
56+
echo "::warning::No release keystore secret is configured, so this APK is signed with a throwaway key and cannot be installed over an existing go2tv."
57+
fi
3558
3659
ANDROID_NDK_HOME=$APATH make android
3760
cp build/Go2TV.apk Go2TV.apk

.github/workflows/build-appimage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
- uses: actions/setup-go@v6
1717
with:
18-
go-version: 'stable'
18+
go-version-file: go.mod
1919

2020
- name: Get dependencies
2121
run: sudo apt update && sudo apt install -y xorg-dev libwayland-dev libxkbcommon-dev libegl-dev libpipewire-0.3-dev pkg-config curl wget tar xz-utils libfuse2t64

.github/workflows/build-arm.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ jobs:
2424
sudo apt install -y xorg-dev libwayland-dev libxkbcommon-dev libegl-dev libpipewire-0.3-dev pkg-config
2525
sudo apt clean
2626
sudo rm -rf /var/lib/apt/lists/*
27-
wget -nv https://go.dev/dl/go1.25.1.linux-armv6l.tar.gz
28-
tar -xzf go1.25.1.linux-armv6l.tar.gz
29-
rm go1.25.1.linux-armv6l.tar.gz
27+
wget -nv https://go.dev/dl/go1.26.0.linux-armv6l.tar.gz
28+
tar -xzf go1.26.0.linux-armv6l.tar.gz
29+
rm go1.26.0.linux-armv6l.tar.gz
3030
export GOROOT=/go
3131
cd /go2tv_dir
32-
/go/bin/go build -tags migrated_fynedo -ldflags "-s -w -X main.version=$(echo ${{ env.GO2TV_VERSION }} | sed 's/^v//')" -o go2tv cmd/go2tv/go2tv.go
32+
/go/bin/go build -tags migrated_fynedo -ldflags "-s -w" -o go2tv ./cmd/go2tv
3333
3434
- uses: actions/upload-artifact@v6
3535
with:

.github/workflows/build-arm64.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ jobs:
1515

1616
- uses: actions/setup-go@v6
1717
with:
18-
go-version: 'stable'
18+
go-version-file: go.mod
1919

2020
- name: Get dependencies
2121
run: sudo apt update && sudo apt install -y xorg-dev libwayland-dev libxkbcommon-dev libegl-dev libpipewire-0.3-dev pkg-config
2222

2323
- name: Package (Linux)
24-
run: go build -tags migrated_fynedo -ldflags "-s -w -X main.version=$(echo ${{ env.GO2TV_VERSION }} | sed 's/^v//')" -o go2tv cmd/go2tv/go2tv.go
24+
run: go build -tags migrated_fynedo -ldflags "-s -w" -o go2tv ./cmd/go2tv
2525

2626
- uses: actions/upload-artifact@v6
2727
with:

.github/workflows/build-linux.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ jobs:
1515

1616
- uses: actions/setup-go@v6
1717
with:
18-
go-version: 'stable'
18+
go-version-file: go.mod
1919

2020
- name: Get dependencies
2121
run: sudo apt update && sudo apt install -y xorg-dev libwayland-dev libxkbcommon-dev libegl-dev libpipewire-0.3-dev pkg-config
2222

2323
- name: Package (Linux)
24-
run: GOOS=linux GOARCH=amd64 go build -tags migrated_fynedo -ldflags "-s -w -X main.version=$(echo ${{ env.GO2TV_VERSION }} | sed 's/^v//')" -o go2tv cmd/go2tv/go2tv.go
24+
run: GOOS=linux GOARCH=amd64 go build -tags migrated_fynedo -ldflags "-s -w" -o go2tv ./cmd/go2tv
2525

2626
- uses: actions/upload-artifact@v6
2727
with:

.github/workflows/build-mac-intel.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,16 @@ jobs:
1515

1616
- uses: actions/setup-go@v6
1717
with:
18-
go-version: 'stable'
18+
go-version-file: go.mod
1919

2020
- name: Install refyne
2121
run: go install github.com/alexballas/refyne/v2/cmd/fyne@latest
2222

23-
- name: Update FyneApp.toml version
24-
run: sed -i '' "s/^Version.*/Version = \"$(echo ${{ env.GO2TV_VERSION }} | sed 's/^v//')\"/" cmd/go2tv/FyneApp.toml
25-
2623
- name: Package (macOS)
2724
run: |
25+
APP_BUILD="$(make print-app-build)"
2826
cd cmd/go2tv
29-
sed -i '' "s/version = \"dev\"/version = \"$(echo ${{ env.GO2TV_VERSION }} | sed 's/^v//')\"/" go2tv.go
30-
CGO_CFLAGS="-mmacosx-version-min=12.3" CGO_LDFLAGS="-mmacosx-version-min=12.3" MACOSX_DEPLOYMENT_TARGET=12.3 GOARCH=amd64 fyne package --release --os darwin --icon ../../assets/go2tv-icon.png
27+
CGO_CFLAGS="-mmacosx-version-min=12.3" CGO_LDFLAGS="-mmacosx-version-min=12.3" MACOSX_DEPLOYMENT_TARGET=12.3 GOARCH=amd64 fyne package --release --os darwin --app-version "${GO2TV_VERSION#v}" --app-build "$APP_BUILD" --icon ../../assets/go2tv-icon.png
3128
mv go2tv.app ../../
3229
3330
- uses: actions/upload-artifact@v6

.github/workflows/build-mac.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,16 @@ jobs:
1515

1616
- uses: actions/setup-go@v6
1717
with:
18-
go-version: 'stable'
18+
go-version-file: go.mod
1919

2020
- name: Install refyne
2121
run: go install github.com/alexballas/refyne/v2/cmd/fyne@latest
2222

23-
- name: Update FyneApp.toml version
24-
run: sed -i '' "s/^Version.*/Version = \"$(echo ${{ env.GO2TV_VERSION }} | sed 's/^v//')\"/" cmd/go2tv/FyneApp.toml
25-
2623
- name: Package (macOS)
2724
run: |
25+
APP_BUILD="$(make print-app-build)"
2826
cd cmd/go2tv
29-
sed -i '' "s/version = \"dev\"/version = \"$(echo ${{ env.GO2TV_VERSION }} | sed 's/^v//')\"/" go2tv.go
30-
CGO_CFLAGS="-mmacosx-version-min=12.3" CGO_LDFLAGS="-mmacosx-version-min=12.3" MACOSX_DEPLOYMENT_TARGET=12.3 GOARCH=arm64 fyne package --release --os darwin --icon ../../assets/go2tv-icon.png
27+
CGO_CFLAGS="-mmacosx-version-min=12.3" CGO_LDFLAGS="-mmacosx-version-min=12.3" MACOSX_DEPLOYMENT_TARGET=12.3 GOARCH=arm64 fyne package --release --os darwin --app-version "${GO2TV_VERSION#v}" --app-build "$APP_BUILD" --icon ../../assets/go2tv-icon.png
3128
mv go2tv.app ../../
3229
3330
- uses: actions/upload-artifact@v6

.github/workflows/build-windows.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ jobs:
2121
go2tv_version="v$version"
2222
fi
2323
24-
windows_app_version="$(printf '%s\n' "$version" | sed -n 's/^\([0-9][0-9.]*\).*/\1/p')"
25-
if [ -z "$windows_app_version" ]; then
24+
if [[ "$version" =~ ^([0-9]+([.][0-9]+)*) ]]; then
25+
windows_app_version="${BASH_REMATCH[1]}"
26+
else
2627
windows_app_version="0.0.0"
2728
fi
2829
@@ -37,7 +38,7 @@ jobs:
3738
3839
- uses: actions/setup-go@v6
3940
with:
40-
go-version: 'stable'
41+
go-version-file: go.mod
4142

4243
- name: Setup MSYS2
4344
uses: msys2/setup-msys2@v2
@@ -50,22 +51,24 @@ jobs:
5051
mingw-w64-x86_64-cppwinrt
5152
mingw-w64-x86_64-pkg-config
5253
53-
- name: Update FyneApp.toml version
54-
shell: msys2 {0}
55-
run: sed -i "s/^Version.*/Version = \"$GO2TV_WINDOWS_APP_VERSION\"/" cmd/go2tv/FyneApp.toml
56-
5754
- name: Package (Windows)
5855
shell: msys2 {0}
5956
run: |
6057
cd cmd/go2tv
61-
sed -i "s/version = \"dev\"/version = \"$(printf '%s\n' "$GO2TV_VERSION" | sed 's/^v//')\"/" go2tv.go
6258
CC_BIN="$(command -v x86_64-w64-mingw32-gcc-win32 || command -v gcc)"
6359
CXX_BIN="$(command -v x86_64-w64-mingw32-g++-win32 || command -v g++)"
6460
CGO_ENABLED=1 CC="$CC_BIN" CXX="$CXX_BIN" CGO_LDFLAGS="-static -static-libgcc -static-libstdc++ -Wl,-Bstatic -l:libstdc++.a -l:libwinpthread.a" GOFLAGS="-ldflags=-linkmode=external -ldflags=-extldflags=-static" go run github.com/alexballas/refyne/v2/cmd/fyne@latest package --release --app-id app.go2tv.go2tv --app-version "$GO2TV_WINDOWS_APP_VERSION" --os windows --icon ../../assets/go2tv-icon-desktop-256.png
6561
objdump -p go2tv.exe | grep "DLL Name" | tee /tmp/go2tv-imports.txt
6662
! grep -Eq "libwinpthread-1.dll|libstdc\+\+-6.dll" /tmp/go2tv-imports.txt
6763
mv go2tv.exe ../../
6864
65+
- name: Build lite (Windows)
66+
shell: bash
67+
run: |
68+
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build \
69+
-trimpath -ldflags "-s -w" \
70+
-o go2tv-lite.exe ./cmd/go2tv-lite
71+
6972
- uses: actions/upload-artifact@v6
7073
with:
7174
name: go2tv_${{ steps.version.outputs.go2tv_version }}_windows_amd64
@@ -74,3 +77,12 @@ jobs:
7477
README.md
7578
go2tv.exe
7679
retention-days: 2
80+
81+
- uses: actions/upload-artifact@v6
82+
with:
83+
name: go2tv_${{ steps.version.outputs.go2tv_version }}_windows_amd64_lite
84+
path: |
85+
LICENSE
86+
README.md
87+
go2tv-lite.exe
88+
retention-days: 2

.github/workflows/go.yml

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,44 @@ jobs:
1010

1111
- uses: actions/setup-go@v6
1212
with:
13-
go-version: 'stable'
13+
go-version-file: go.mod
1414

1515
- name: Install Linux deps
1616
run: sudo apt update && sudo apt install -y xorg-dev libwayland-dev libxkbcommon-dev libegl-dev libpipewire-0.3-dev pkg-config
1717

1818
- name: Build
1919
run: go build -v ./...
20-
20+
2121
- name: Test
22-
run: go test -v ./...
22+
# The pipewire pkg-config exposes -fno-strict-overflow, which cgo rejects
23+
# unless it is explicitly allowed. Required to link the GUI package under -race.
24+
env:
25+
CGO_CFLAGS_ALLOW: -fno-strict-overflow
26+
run: go test -race -v ./...
27+
28+
webui:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v6
32+
33+
- uses: actions/setup-node@v5
34+
with:
35+
node-version: 22
36+
cache: npm
37+
38+
- name: Install web deps
39+
run: npm ci
40+
41+
- name: Test
42+
run: npm test
43+
44+
- name: Verify dist matches src
45+
# internal/webui/dist is committed and embedded into the Go binary, so a
46+
# rebuild must be a no-op. Otherwise the shipped UI silently lags its source.
47+
run: |
48+
npm run build:webui
49+
if [ -n "$(git status --porcelain internal/webui/dist)" ]; then
50+
echo "internal/webui/dist is stale. Run 'npm run build:webui' and commit the result."
51+
git status --porcelain internal/webui/dist
52+
exit 1
53+
fi

.github/workflows/release-draft.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535

3636
- uses: actions/setup-go@v6
3737
with:
38-
go-version: 'stable'
38+
go-version-file: go.mod
3939

4040
- name: Normalize version
4141
id: version
@@ -88,6 +88,7 @@ jobs:
8888
`go2tv_${versionTag}_macOS_amd64`,
8989
`go2tv_${versionTag}_macOS_arm64`,
9090
`go2tv_${versionTag}_windows_amd64`,
91+
`go2tv_${versionTag}_windows_amd64_lite`,
9192
];
9293
9394
const candidates = artifacts.filter((artifact) => {

0 commit comments

Comments
 (0)