Skip to content

Commit

Permalink
Fixing workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
hsnfirdaus committed Feb 6, 2025
1 parent 97d88c0 commit 9941e3f
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 20 deletions.
45 changes: 30 additions & 15 deletions .github/workflows/release-candidate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,9 @@ jobs:
build:
strategy:
matrix:
build:
- name: "RCLinux"
platform: "linux/amd64"
os: "ubuntu-latest"
- name: "RCWindows"
platform: "windows/amd64"
os: "windows-latest"

runs-on: ${{ matrix.build.os }}
os: [ubuntu-latest, windows-latest]

runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -42,19 +36,39 @@ jobs:
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev flatpak flatpak-builder jq
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
- name: Build Linux
if: startsWith(matrix.os, 'ubuntu')
run: ./build/linux/build.sh
run: ./build/linux/build.sh --sudo

- name: Install Windows Dependency
if: startsWith(matrix.os, 'windows')
run: choco install nsis -y
run: choco install nsis jq -y

- name: Extract Version from wails.json
run: echo "VERSION=$(jq -r '.info.productVersion' wails.json)" >> $GITHUB_ENV
shell: bash

- name: Build Windows
if: startsWith(matrix.os, 'windows')
run: wails build -nsis
run: wails build -nsis -o iptv-desktop-${{ env.VERSION }}-${{ runner.arch }}.exe
shell: bash

- name: Replace Name Windows
if: startsWith(matrix.os, 'windows')
shell: bash
run: |
cd build/bin
for file in iptv-desktop-*-installer.exe; do
mv "$file" "${file/iptv-desktop-/iptv-desktop-${{ env.VERSION }}-}"
done
- name: Replace Name Linux
if: startsWith(matrix.os, 'ubuntu')
run: |
cd build/bin
mv iptv-desktop iptv-desktop-${{ env.VERSION }}-${{ runner.arch }}.bin
- name: Archive Build Artifact
uses: actions/upload-artifact@v4
Expand All @@ -78,12 +92,13 @@ jobs:
- name: Download all build artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
path: artifacts/

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
prerelease: true
tag_name: v${{ env.VERSION }}-rc
target_commitish: rc
name: v${{ env.VERSION }}-rc
files: artifacts
files: artifacts/**/*
15 changes: 11 additions & 4 deletions build/linux/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"

cd "$PROJECT_ROOT" || exit 1

rm -rf build/bin
rm -rf build/linux/installer
mkdir build/linux/installer

Expand All @@ -27,8 +28,14 @@ nfpm package -f ./nfpm.yaml -p rpm -t ./installer
nfpm package -f ./nfpm.yaml -p deb -t ./installer

cd flatpak
flatpak install flathub org.gnome.Platform//46 org.gnome.Sdk//46
flatpak-builder --force-clean --user --repo=repo builddir io.github.iptv_app.iptv_desktop.yaml
flatpak build-bundle repo ../installer/iptv-desktop_"$VERSION"_"$ARCH".flatpak io.github.iptv_app.iptv_desktop --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo

cd "$START_DIR" || exit 1
use_sudo=""
if [[ "$1" == "--sudo" ]]; then
use_sudo="sudo"
fi

$use_sudo flatpak install --noninteractive -y flathub org.gnome.Platform//46 org.gnome.Sdk//46
$use_sudo flatpak-builder -y --force-clean --user --repo=repo builddir io.github.iptv_app.iptv_desktop.yaml
$use_sudo flatpak build-bundle repo ../installer/iptv-desktop_"$VERSION"_"$ARCH".flatpak io.github.iptv_app.iptv_desktop --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo

cd "$START_DIR"
2 changes: 1 addition & 1 deletion build/windows/installer/wails_tools.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
!define INFO_PRODUCTNAME "IPTV Desktop"
!endif
!ifndef INFO_PRODUCTVERSION
!define INFO_PRODUCTVERSION "1.0.0"
!define INFO_PRODUCTVERSION "0.5.0"
!endif
!ifndef INFO_COPYRIGHT
!define INFO_COPYRIGHT "Copyright 2025 IPTV App"
Expand Down

0 comments on commit 9941e3f

Please sign in to comment.