Skip to content

Commit

Permalink
Merge pull request #7 from Ryex/update-for-latest
Browse files Browse the repository at this point in the history
Update for latest Dungeondraft
  • Loading branch information
Ryex authored Sep 25, 2024
2 parents 191f0e0 + 0bde739 commit d1f542f
Show file tree
Hide file tree
Showing 42 changed files with 4,270 additions and 1,214 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
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@v3
with:
go-version: ${{ matrix.go-version }}

- name: Checkout code
uses: actions/checkout@v3

- 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: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
body_path: CHANGELOG.md
draft: true
files: |
dungeondraft-packager*
README.md
LICENSE.md
7 changes: 0 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
*.png
*.webp
*.jpg
*.json
*.dungeondraft_*
*.log
vendor/
gui/
49 changes: 49 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

<!-- insertion marker -->
## [2.0.0+pre-1](https://github.com/Ryex/Dungeondraft-GoPackager/releases/tag/2.0.0+pre-1) - 2024-09-24

<small>[Compare with v1.1.0](https://github.com/Ryex/Dungeondraft-GoPackager/compare/v1.1.0...2.0.0+pre-1)</small>

### Features

- finialize packaging gui ([27210cb](https://github.com/Ryex/Dungeondraft-GoPackager/commit/27210cb576d49edeaf3793e71bca537ab3f73069) by Rachel Powers).
- initial gui ([2f60012](https://github.com/Ryex/Dungeondraft-GoPackager/commit/2f600127f1c6918a5ef4f43554cb14d2d72d1369) by Rachel Powers).
- start of gui ([75fdbd0](https://github.com/Ryex/Dungeondraft-GoPackager/commit/75fdbd07b88885548c9a56974a522c071bb6aa38) by Rachel Powers).
- track image format ([8699a4a](https://github.com/Ryex/Dungeondraft-GoPackager/commit/8699a4a5321e790be87a0d713f2f9572043a873d) by Rachel Powers).
- impl generate thumbnails ([9d62b6f](https://github.com/Ryex/Dungeondraft-GoPackager/commit/9d62b6f631016660fed7587b20d219ba7ede02b5) by Rachel Powers).

### Code Refactoring

- merge packer and unpacker structs ([0e9fdfa](https://github.com/Ryex/Dungeondraft-GoPackager/commit/0e9fdfadca20dcdcb33a83d44de50b72d76dc5e9) by Rachel Powers).
- better FileInfo init ([dc92fff](https://github.com/Ryex/Dungeondraft-GoPackager/commit/dc92fffeed05a5092b24710d90b66d363b731217) by Rachel Powers).
- rename binary ([745b024](https://github.com/Ryex/Dungeondraft-GoPackager/commit/745b024d592c011e6f706a4e22deeeef88fa84dc) by Rachel Powers).
- merge command binaries, use kong for cli parsing, seperate generate command, list cmd ([fc9b8ca](https://github.com/Ryex/Dungeondraft-GoPackager/commit/fc9b8ca7ac15eaed1f291d8ff9fb0b48ca689901) by Rachel Powers).
- update for useing with latest dungeondraft (GoDot 3.4.2) ([872512f](https://github.com/Ryex/Dungeondraft-GoPackager/commit/872512faec06d52be95b93ecef39c0a46cfe391e) by Rachel Powers).



## [v1.1.0](https://github.com/Ryex/Dungeondraft-GoPackager/releases/tag/v1.1.0) - 2020-07-16

<small>[Compare with v1.0.2](https://github.com/Ryex/Dungeondraft-GoPackager/compare/v1.0.2...v1.1.0)</small>

## [v1.0.2](https://github.com/Ryex/Dungeondraft-GoPackager/releases/tag/v1.0.2) - 2020-07-16

<small>[Compare with v1.0.1](https://github.com/Ryex/Dungeondraft-GoPackager/compare/v1.0.1...v1.0.2)</small>

## [v1.0.1](https://github.com/Ryex/Dungeondraft-GoPackager/releases/tag/v1.0.1) - 2020-07-07

<small>[Compare with v1.0.0](https://github.com/Ryex/Dungeondraft-GoPackager/compare/v1.0.0...v1.0.1)</small>

## [v1.0.0](https://github.com/Ryex/Dungeondraft-GoPackager/releases/tag/v1.0.0) - 2020-06-21

<small>[Compare with v0.1.0](https://github.com/Ryex/Dungeondraft-GoPackager/compare/v0.1.0...v1.0.0)</small>

## [v0.1.0](https://github.com/Ryex/Dungeondraft-GoPackager/releases/tag/v0.1.0) - 2020-06-20

<small>[Compare with first commit](https://github.com/Ryex/Dungeondraft-GoPackager/compare/b36d63374d2e7f5ca3f5553c37d12561dcc3956b...v0.1.0)</small>
9 changes: 9 additions & 0 deletions FyneApp.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

Website = "https://ryex.github.io/Dungeondraft-GoPackager/"

[Details]
Icon = "Icon.png"
Name = "Dungeondraft GoPackager"
ID = "io.github.ryex.dungondraft-gopackager"
Version = "2.0.0"
Build = 1
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ The pack tool by default does not on its own generate an ID for your package.

So, it must have been pack at least once by Dungeondraft itself and have a valid `pack.json`
OR
A `pack.json` must be created by using the flags to pass in th pack name and version with an optional author.
A `pack.json` must be created by using the flags to pass in the pack name and version with an optional author.

Windows executable are provided so you don't have to build it yourself.

### Instation

you can either install the precompiled binaries avalible on the [release page](https://github.com/Ryex/Dungeondraft-GoPackager/releases)
you can either install the precompiled binaries available on the [release page](https://github.com/Ryex/Dungeondraft-GoPackager/releases)

Or, if you have [Go](https://go.dev/) installed you can `go install` them yourself

Expand Down
166 changes: 0 additions & 166 deletions cmd/dungeondraft-pack/dungeondraft-pack.go

This file was deleted.

43 changes: 43 additions & 0 deletions cmd/dungeondraft-packager-cli/dungeondraft-packager-cli.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package main

import (
"os"

"github.com/alecthomas/kong"
"github.com/ryex/dungeondraft-gopackager/internal/cmd"

log "github.com/sirupsen/logrus"
)

var CLI struct {
LogLevel log.Level `short:"v" type:"counter" help:"log level, 0 = Error, 1 = Warn (-v), 2 = Info (-vv), 3 = Debug (-vvv), 4 = Trace (-vvvv)"`

Pack cmd.PackCmd `cmd:"" help:"Packs the contents of a directory to a .dungeondraft_pack file, there must be a valid pack.json in the directory"`
Unpack cmd.UnpackCmd `cmd:"" help:"Extracts the contesnts of a .dungeondraft_pack file"`
Generate cmd.GenCmd `cmd:"" aliases:"gen" help:"Generate pack data and thumbtails"`
List cmd.ListCmd `cmd:"" aliases:"ls" help:"list resources in a .dungeondraft_pack file"`
}

func main() {
ctx := kong.Parse(&CLI,
kong.Name("dungeondraft-packager-cli"),
kong.Description("Pack, Unpack, Edit, and Prepare resources for .dungeondraft_pack files"),
kong.UsageOnError(),
kong.ConfigureHelp(
kong.HelpOptions{
Compact: true,
Summary: true,
}),
// vars
)

level := CLI.LogLevel + 2
log.SetLevel(level)
log.SetOutput(os.Stderr)
log.SetFormatter(&log.TextFormatter{
ForceColors: true,
})

err := ctx.Run(&cmd.Context{})
ctx.FatalIfErrorf(err)
}
Binary file added cmd/dungeondraft-packager/Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
38 changes: 38 additions & 0 deletions cmd/dungeondraft-packager/dungeondraft-packager.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package main

import (
"os"

"github.com/alecthomas/kong"
"github.com/ryex/dungeondraft-gopackager/internal/gui"

log "github.com/sirupsen/logrus"
)

var CLI struct {
LogLevel log.Level `short:"v" type:"counter" help:"log level, 0 = Error, 1 = Warn (-v), 2 = Info (-vv), 3 = Debug (-vvv), 4 = Trace (-vvvv)"`
}

func main() {
kong.Parse(&CLI,
kong.Name("dungeondraft-packager"),
kong.Description("Pack, Unpack, Edit, and Prepare resources for .dungeondraft_pack files"),
kong.UsageOnError(),
kong.ConfigureHelp(
kong.HelpOptions{
Compact: true,
Summary: true,
}),
// vars
)

level := CLI.LogLevel + 2
log.SetLevel(level)
log.SetOutput(os.Stderr)
log.SetFormatter(&log.TextFormatter{
ForceColors: true,
})

app := gui.NewApp()
app.Main()
}
Loading

0 comments on commit d1f542f

Please sign in to comment.