Skip to content

ci: fix windows packaging #34

ci: fix windows packaging

ci: fix windows packaging #34

Workflow file for this run

name: build
on: push
permissions:
packages: write
contents: write
jobs:
build:
name: "Build Dungeondraft-GoPackager (${{ matrix.target.os }}, ${{ matrix.go-version }})"
runs-on: ${{ matrix.target.host || 'ubuntu-latest' }}
env:
GO111MODULE: on
strategy:
fail-fast: false
matrix:
go-version: ["1.23.x"]
target:
- os: linux
- os: windows
ext: .exe
host: windows-latest
- os: darwin
host: macos-latest
steps:
- name: Setup Go environment
id: setup-go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v4
- name: Cache build artifacts
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/.cache/fyne-cross
key: ${{ runner.os }}-build-cache-${{ hashFiles('**/go.sum') }}
- name: Install Build Deps (Linux)
if: ${{ runner.os == 'linux' }}
run: sudo apt-get install golang gcc libgl1-mesa-dev xorg-dev
- name: Install Fyne
run: go install fyne.io/fyne/v2/cmd/fyne@latest
- name: install go deps
run: go mod download
- name: Build gui
run: |
cp FyneApp.toml ./cmd/dungeondraft-packager
fyne package -src ./cmd/dungeondraft-packager --release -appID io.github.ryex.dungondraft-gopackager
- name: Build cli
run: |
go build -ldflags "-s -w" ./cmd/dungeondraft-packager-cli
- name: List dir
run: |
ls .
ls ./cmd/dungeondraft-packager
- name: Prep artifacts (windows)
if: ${{ runner.os == 'windows' }}
run: |
mv "./cmd/dungeondraft-packager/Dungeondraft GoPackager.exe" ./dungeondraft-packager.exe
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Dungeondraft-GoPackager-${{ runner.os }}
path: |
dungeondraft-packager*
README.md
LICENSE.md
CHANGELOG.md
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: List dir
run: ls
- name: Package
run: |
pushd Dungeondraft-GoPackager-Linux ; tar -czf ../Dungeondraft-GoPackager-Linux.tgz * ; popd
pushd Dungeondraft-GoPackager-macOS ; zip -r ../Dungeondraft-GoPackager-macOS.zip * ; popd
pushd Dungeondraft-GoPackager-Windows ; zip -r ../Dungeondraft-GoPackager-Windows.zip * ; popd
- name: Release
uses: softprops/action-gh-release@v2
with:
body_path: Dungeondraft-GoPackager-Linux/CHANGELOG.md
draft: true
files: |
Dungeondraft-GoPackager-Linux.tar.gz
Dungeondraft-GoPackager-macOS.zip
Dungeondraft-GoPackager-Windows.zip