feat: edit resource tags #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | | |
fyne package -src ./cmd/dungeondraft-packager -appID io.github.ryex.dungondraft-gopackager | |
- name: Build cli | |
run: | | |
go build -ldflags "-s -w" ./cmd/dungeondraft-packager-cli | |
- name: Prep artifacts (windows) | |
if: ${{ runner.os == 'windows' }} | |
run: | | |
mv cmd/dungeondraft-packager/dungeondraft-packager.exe . | |
- name: List dir | |
run: ls | |
- 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: Grab and store version | |
run: | | |
tag_name=$(echo ${{ github.ref }} | grep -oE "[^/]+$") | |
echo "VERSION=$tag_name" >> $GITHUB_ENV | |
- name: List dir | |
run: ls | |
- name: Package | |
run: | | |
pushd Dungeondraft-GoPackager-Linux ; tar -czf ../Dungeondraft-GoPackager-Linux-${{ env.VERSION }}.tar.gz * ; popd | |
pushd Dungeondraft-GoPackager-macOS ; zip -r ../Dungeondraft-GoPackager-macOS-${{ env.VERSION }}.zip * ; popd | |
pushd Dungeondraft-GoPackager-Windows ; zip -r ../Dungeondraft-GoPackager-Windows-${{ env.VERSION }}.zip * ; popd | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
body_path: Dungeondraft-GoPackager-Linux/CHANGELOG.md | |
draft: true | |
files: | | |
Dungeondraft-GoPackager-Linux-${{ env.VERSION }}.tar.gz | |
Dungeondraft-GoPackager-macOS-${{ env.VERSION }}.zip | |
Dungeondraft-GoPackager-Windows-${{ env.VERSION }}.zip | |