mirror of
https://github.com/AynaLivePlayer/AynaLivePlayer.git
synced 2025-12-07 02:42:50 +08:00
try fix windows try fix windows fix again add windows debug build try ucrt fix ucrt env use different mpv build aaaa bbb disable vlc for now test build mpv only update vlc version for windows add go.sum
121 lines
3.3 KiB
YAML
121 lines
3.3 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- dev
|
|
|
|
jobs:
|
|
build-windows:
|
|
runs-on: windows-latest
|
|
timeout-minutes: 20
|
|
|
|
env:
|
|
GOOS: windows
|
|
GOARCH: amd64
|
|
EXECUTABLE: AynaLivePlayer.exe
|
|
CGO_CFLAGS: "-I${{ github.workspace }}/libmpv/include -I${{ github.workspace }}/libvlc/VideoLAN.LibVLC.Windows.3.0.21/build/x64/include"
|
|
CGO_LDFLAGS: "-L${{ github.workspace }}/libmpv -L${{ github.workspace }}/libvlc/VideoLAN.LibVLC.Windows.3.0.21/build/x64"
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install 7-Zip
|
|
run: choco install 7zip
|
|
|
|
- name: Download libmpv
|
|
uses: robinraju/release-downloader@v1
|
|
with:
|
|
repository: "shinchiro/mpv-winbuild-cmake"
|
|
latest: true
|
|
fileName: "mpv-dev-x86_64-[0-9]*.7z"
|
|
extract: false
|
|
out-file-path: "libmpv"
|
|
|
|
- name: Extract libmpv
|
|
run: |
|
|
7z x "libmpv/mpv-dev-x86_64-*.7z" -o"libmpv"
|
|
|
|
- name: Setup NuGet.exe
|
|
uses: nuget/setup-nuget@v2
|
|
with:
|
|
nuget-version: 'latest'
|
|
|
|
- name: Install VLC dependency
|
|
run: nuget install VideoLAN.LibVLC.Windows -OutputDirectory ${{ github.workspace }}/libvlc -Version 3.0.21
|
|
|
|
- name: Install Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.22'
|
|
|
|
- name: Install Go Dependencies
|
|
run: |
|
|
go mod tidy
|
|
go install fyne.io/tools/cmd/fyne@latest
|
|
|
|
- name: Bundle assets
|
|
run: |
|
|
fyne bundle --name resImageIcon --package resource ./assets/icon2.png > ./resource/bundle.go
|
|
|
|
- name: Build application
|
|
run: |
|
|
go build -tags=mpvOnly -v -o ./AynaLivePlayerMpv.exe -ldflags -H=windowsgui app/main.go
|
|
go build -tags=vlcOnly -v -o ./AynaLivePlayerVlc.exe -ldflags -H=windowsgui app/main.go
|
|
go build -v -o ./AynaLivePlayerAllPlayer.exe -ldflags -H=windowsgui app/main.go
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: windows-build
|
|
path: |
|
|
./AynaLivePlayerMpv.exe
|
|
./AynaLivePlayerVlc.exe
|
|
./AynaLivePlayerAllPlayer.exe
|
|
|
|
build-ubuntu:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
|
|
env:
|
|
GOOS: linux
|
|
GOARCH: amd64
|
|
EXECUTABLE: AynaLivePlayer
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libvlc-dev vlc libmpv-dev libgl-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libgl1-mesa-dev xorg-dev
|
|
|
|
- name: Install Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.22'
|
|
|
|
- name: Install Go Dependencies
|
|
run: |
|
|
go mod tidy
|
|
go install fyne.io/tools/cmd/fyne@latest
|
|
|
|
- name: Bundle assets
|
|
run: |
|
|
fyne bundle --name resImageIcon --package resource ./assets/icon.png > ./resource/bundle.go
|
|
|
|
- name: Build application
|
|
run: go build -o ./${{ env.EXECUTABLE }} app/main.go
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ubuntu-build
|
|
path: ./${{ env.EXECUTABLE }}
|