28 Commits

Author SHA1 Message Date
c1885f174a Update README.md
All checks were successful
CI / Lint (push) Successful in 3m49s
CI / Test (push) Successful in 3m57s
CI / Build (push) Successful in 1m56s
2024-08-11 04:19:25 +00:00
s1d3sw1ped
0650dabb15 Update .gitea/workflows/tag-release.yaml
All checks were successful
CI / Lint (push) Successful in 2m34s
CI / Test (push) Successful in 2m48s
CI / Build (push) Successful in 3m29s
Release versioned tag / Lint (push) Successful in 2m9s
Release versioned tag / Test (push) Successful in 2m36s
Release versioned tag / Build versioned release (push) Successful in 3m35s
re-enable release binaries
2024-07-26 15:10:47 +00:00
42af2d6d25 remove toolcache env its hardcoded in the runners config now
All checks were successful
CI / Test (push) Successful in 1m12s
CI / Lint (push) Successful in 1m17s
CI / Build (push) Successful in 1m17s
2024-07-17 23:27:22 -05:00
2dbc72bd39 minor cleanup of artifact names
All checks were successful
CI / Test (push) Successful in 1m2s
CI / Build (push) Successful in 1m22s
CI / Lint (push) Successful in 51s
2024-07-17 22:37:21 -05:00
d46a142312 test
All checks were successful
CI / Lint (push) Successful in 38s
CI / Test (push) Successful in 1m13s
CI / Build (push) Successful in 1m37s
2024-07-17 22:23:27 -05:00
caa699c651 fix ci
Some checks failed
CI / Test (push) Failing after 13s
CI / Build (push) Failing after 12s
CI / Lint (push) Failing after 16s
2024-07-17 21:35:05 -05:00
s1d3sw1ped
c5f77582c0 Merge pull request 'fix typo in tag-release' (#29) from develop into master
Some checks failed
CI / Build (push) Failing after 23s
CI / Test (push) Has been cancelled
CI / Lint (push) Failing after 13s
Reviewed-on: #29
2024-05-20 09:50:42 +00:00
06503ce518 fix typo in tag-release
All checks were successful
CI / Build (push) Successful in 1m38s
CI / Test (push) Successful in 2m4s
CI / Lint (push) Successful in 2m7s
CI / Lint (pull_request) Successful in 1m30s
CI / Test (pull_request) Successful in 1m56s
CI / Build (pull_request) Successful in 1m36s
2024-05-20 04:49:48 -05:00
s1d3sw1ped
f1603dc6fa Merge pull request 'small temporary fix for release updating not working' (#28) from develop into master
All checks were successful
CI / Test (push) Successful in 2m13s
CI / Lint (push) Successful in 2m16s
CI / Build (push) Successful in 2m51s
Reviewed-on: #28
2024-05-20 09:46:30 +00:00
f8932166bb disable release update until fixed
All checks were successful
CI / Test (push) Successful in 1m10s
CI / Lint (push) Successful in 2m14s
CI / Test (pull_request) Successful in 1m39s
CI / Lint (pull_request) Successful in 1m54s
CI / Build (push) Successful in 3m3s
CI / Build (pull_request) Successful in 2m16s
2024-05-20 04:31:27 -05:00
ffd41348a0 small temporary fix for release updating not working
Some checks failed
CI / Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Build (push) Has been cancelled
CI / Lint (pull_request) Successful in 2m7s
CI / Test (pull_request) Successful in 1m56s
CI / Build (pull_request) Successful in 3m18s
2024-05-20 04:29:53 -05:00
s1d3sw1ped
12a9c101f2 Merge pull request 'Merge pull request 'update-develop' (#26) from update-develop into develop' (#27) from develop into master
Some checks failed
CI / Test (push) Successful in 1m21s
CI / Lint (push) Successful in 1m55s
CI / Build (push) Successful in 2m33s
Release versioned tag / Test (push) Successful in 1m35s
Release versioned tag / Lint (push) Successful in 2m5s
Release versioned tag / Build versioned release (push) Failing after 2m11s
Reviewed-on: #27
2024-05-20 07:22:04 +00:00
s1d3sw1ped
ff6381575e Merge pull request 'update-develop' (#26) from update-develop into develop
All checks were successful
CI / Lint (push) Successful in 1m35s
CI / Test (push) Successful in 1m27s
CI / Lint (pull_request) Successful in 1m47s
CI / Test (pull_request) Successful in 1m23s
CI / Build (push) Successful in 2m43s
CI / Build (pull_request) Successful in 2m23s
Reviewed-on: #26
2024-05-20 07:21:42 +00:00
s1d3sw1ped
acb4401e37 Merge pull request 'fix-ci' (#25) from fix-ci into master
All checks were successful
CI / Test (push) Successful in 1m39s
CI / Lint (push) Successful in 1m48s
CI / Build (push) Successful in 2m57s
CI / Test (pull_request) Successful in 1m43s
CI / Lint (pull_request) Successful in 1m53s
CI / Build (pull_request) Successful in 2m50s
Reviewed-on: #25
2024-05-20 07:01:22 +00:00
76d8c1744a fix ci stuff for other things
All checks were successful
CI / Test (pull_request) Successful in 1m36s
CI / Lint (pull_request) Successful in 1m39s
CI / Build (pull_request) Successful in 2m39s
2024-05-20 01:58:17 -05:00
s1d3sw1ped
b2bef77f09 Merge pull request 'small typo fix and removed unneeded global variable' (#23) from cleanup_typos into develop
Some checks failed
CI / Lint (push) Failing after 36s
CI / Test (push) Successful in 1m37s
CI / Test (pull_request) Successful in 1m17s
CI / Lint (pull_request) Successful in 1m55s
CI / Build (push) Successful in 2m56s
CI / Build (pull_request) Successful in 2m20s
Reviewed-on: #23
2024-05-20 06:51:53 +00:00
4cbb0666cb add run number to artifacts
All checks were successful
CI / Test (pull_request) Successful in 1m27s
CI / Lint (pull_request) Successful in 2m2s
CI / Build (pull_request) Successful in 2m41s
2024-05-20 01:47:36 -05:00
83cb34001f fyne metadata sucks so jst custom stuff
All checks were successful
CI / Test (pull_request) Successful in 1m17s
CI / Lint (pull_request) Successful in 1m58s
CI / Build (pull_request) Successful in 2m36s
2024-05-20 01:37:58 -05:00
1f09482950 remove version and build from fyneapp.toml
All checks were successful
CI / Test (pull_request) Successful in 1m32s
CI / Lint (pull_request) Successful in 1m57s
CI / Build (pull_request) Successful in 2m41s
2024-05-20 01:00:32 -05:00
1af4d225b5 add os dependencies to lint
All checks were successful
CI / Test (pull_request) Successful in 1m28s
CI / Lint (pull_request) Successful in 1m52s
CI / Build (pull_request) Successful in 2m47s
2024-05-20 00:47:05 -05:00
7863c53280 test
Some checks failed
CI / Lint (pull_request) Failing after 54s
CI / Test (pull_request) Successful in 2m3s
CI / Build (pull_request) Successful in 2m49s
2024-05-20 00:35:08 -05:00
s1d3sw1ped
35d888ec62 Merge pull request 'merge master into develop' (#22) from master into develop
All checks were successful
CI / Lint (push) Successful in 1m10s
CI / Test (push) Successful in 3m38s
CI / Build (push) Successful in 4m9s
Reviewed-on: #22
2024-03-12 05:16:43 +00:00
s1d3sw1ped
15e317b6fe Merge pull request 'fix' (#21) from fix3 into master
All checks were successful
CI / Lint (push) Successful in 50s
CI / Test (push) Successful in 3m32s
CI / Build (push) Successful in 4m4s
CI / Lint (pull_request) Successful in 1m2s
CI / Test (pull_request) Successful in 3m46s
CI / Build (pull_request) Successful in 4m18s
Reviewed-on: #21
2024-03-12 05:03:56 +00:00
07f11c7d22 fix
Some checks failed
CI / Build (pull_request) Has been cancelled
CI / Test (pull_request) Has been cancelled
CI / Lint (pull_request) Has been cancelled
2024-03-12 00:03:21 -05:00
s1d3sw1ped
7c28081b65 Merge pull request 'fix' (#20) from fix2 into master
All checks were successful
CI / Lint (push) Successful in 40s
CI / Build (push) Successful in 3m22s
CI / Test (push) Successful in 3m42s
Reviewed-on: #20
2024-03-12 04:56:40 +00:00
d9a75a5e21 fix
Some checks failed
CI / Test (pull_request) Has been cancelled
CI / Lint (pull_request) Has been cancelled
CI / Build (pull_request) Has been cancelled
2024-03-11 23:56:22 -05:00
s1d3sw1ped
5da6636dd7 Merge pull request 'blah' (#19) from fix into master
All checks were successful
CI / Lint (push) Successful in 55s
CI / Test (push) Successful in 3m45s
CI / Build (push) Successful in 4m16s
Reviewed-on: #19
2024-03-12 04:40:10 +00:00
b04e653350 blah
Some checks failed
CI / Test (pull_request) Has been cancelled
CI / Build (pull_request) Has been cancelled
CI / Lint (pull_request) Has been cancelled
2024-03-11 23:39:24 -05:00
6 changed files with 60 additions and 34 deletions

View File

@@ -5,8 +5,6 @@ on:
jobs: jobs:
lint: lint:
name: Lint name: Lint
env:
RUNNER_TOOL_CACHE: /toolcache
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
@@ -19,6 +17,11 @@ jobs:
check-latest: true check-latest: true
cache: true cache: true
- name: Setup OS dependencies
run: |
apt-get update
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
- name: Install go dependencies - name: Install go dependencies
run: go mod tidy run: go mod tidy
@@ -29,8 +32,6 @@ jobs:
test: test:
name: Test name: Test
env:
RUNNER_TOOL_CACHE: /toolcache
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
@@ -61,8 +62,6 @@ jobs:
build: build:
name: Build name: Build
env:
RUNNER_TOOL_CACHE: /toolcache
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
@@ -90,8 +89,7 @@ jobs:
- name: Build for linux - name: Build for linux
run: | run: |
fyne package --os ${{GOOS}} --release --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION#v}.${BUILD}-linux-amd64 main.go fyne build --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION}-${BUILD}-${GOOS}-${GOARCH}
mv *.tar.xz bin/swiped-mod-switcher-${VERSION#v}.${BUILD}-linux-amd64.tar.xz
env: env:
VERSION: ${{github.ref_name}} VERSION: ${{github.ref_name}}
BUILD: ${{github.run_number}} BUILD: ${{github.run_number}}
@@ -103,7 +101,7 @@ jobs:
- name: Build for windows - name: Build for windows
run: | run: |
fyne package --os ${{GOOS}} --release --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION#v}.${BUILD}-windows-amd64.exe main.go fyne build --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION}-${BUILD}-${GOOS}-${GOARCH}.exe
env: env:
VERSION: ${{github.ref_name}} VERSION: ${{github.ref_name}}
BUILD: ${{github.run_number}} BUILD: ${{github.run_number}}
@@ -116,5 +114,5 @@ jobs:
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: swiped-mod-switcher-${{github.ref_name}} name: swiped-mod-switcher-${{github.ref_name}}-${{github.run_number}}
path: bin/ path: bin/

View File

@@ -6,13 +6,14 @@ on:
jobs: jobs:
lint: lint:
name: Lint name: Lint
env:
RUNNER_TOOL_CACHE: /toolcache
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: test log
run: env | sort
- name: Setup go - name: Setup go
uses: actions/setup-go@v5 uses: actions/setup-go@v5
with: with:
@@ -20,6 +21,11 @@ jobs:
check-latest: true check-latest: true
cache: true cache: true
- name: Setup OS dependencies
run: |
apt-get update
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
- name: Install go dependencies - name: Install go dependencies
run: go mod tidy run: go mod tidy
@@ -30,8 +36,6 @@ jobs:
test: test:
name: Test name: Test
env:
RUNNER_TOOL_CACHE: /toolcache
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
@@ -62,8 +66,6 @@ jobs:
build: build:
name: Build name: Build
env:
RUNNER_TOOL_CACHE: /toolcache
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
@@ -91,7 +93,7 @@ jobs:
- name: Build for linux - name: Build for linux
run: | run: |
fyne build --os=${{GOOS}} --metadata Version=${{VERSION}} --metadata Build=${{BUILD}} -o bin/sw1ped-mod-switcher-${{VERSION#v}}.${{BUILD}}-${{GOOS}}-${{GOARCH}} main.go fyne build --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION}-${BUILD}-${GOOS}-${GOARCH}
ls bin ls bin
env: env:
VERSION: ${{github.ref_name}} VERSION: ${{github.ref_name}}
@@ -103,7 +105,7 @@ jobs:
- name: Build for windows - name: Build for windows
run: | run: |
fyne build --os=${{GOOS}} --metadata Version=${{VERSION}} --metadata Build=${{BUILD}} -o bin/sw1ped-mod-switcher-${{VERSION#v}}.${{BUILD}}-${{GOOS}}-${{GOARCH}}.exe main.go fyne build --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION}-${BUILD}-${GOOS}-${GOARCH}.exe
ls bin ls bin
env: env:
VERSION: ${{github.ref_name}} VERSION: ${{github.ref_name}}
@@ -116,5 +118,5 @@ jobs:
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: swiped-mod-switcher-${{github.ref_name}} name: swiped-mod-switcher-${{github.ref_name}}-${{github.run_number}}
path: bin/ path: bin/

View File

@@ -7,8 +7,6 @@ on:
jobs: jobs:
lint: lint:
name: Lint name: Lint
env:
RUNNER_TOOL_CACHE: /toolcache
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
@@ -21,6 +19,11 @@ jobs:
check-latest: true check-latest: true
cache: true cache: true
- name: Setup OS dependencies
run: |
apt-get update
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
- name: Install go dependencies - name: Install go dependencies
run: go mod tidy run: go mod tidy
@@ -31,8 +34,6 @@ jobs:
test: test:
name: Test name: Test
env:
RUNNER_TOOL_CACHE: /toolcache
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
@@ -87,8 +88,7 @@ jobs:
- name: Build for linux - name: Build for linux
run: | run: |
fyne package --release --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION#v}.${BUILD}-linux-amd64 main.go fyne build --release --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION#v}-${BUILD}-${GOOS}-${GOARCH}
mv *.tar.xz bin/swiped-mod-switcher-${VERSION#v}.${BUILD}-linux-amd64.tar.xz
env: env:
VERSION: ${{github.ref_name}} VERSION: ${{github.ref_name}}
BUILD: ${{github.run_number}} BUILD: ${{github.run_number}}
@@ -100,7 +100,7 @@ jobs:
- name: Build for windows - name: Build for windows
run: | run: |
fyne package --release --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION#v}.${BUILD}-windows-amd64.exe main.go fyne build --release --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION#v}-${BUILD}-${GOOS}-${GOARCH}.exe
env: env:
VERSION: ${{github.ref_name}} VERSION: ${{github.ref_name}}
BUILD: ${{github.run_number}} BUILD: ${{github.run_number}}
@@ -110,6 +110,12 @@ jobs:
CGO_ENABLED: 1 CGO_ENABLED: 1
CC: x86_64-w64-mingw32-gcc CC: x86_64-w64-mingw32-gcc
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: swiped-mod-switcher-${{github.ref_name}}-${{github.run_number}}
path: bin/
- name: Release binaries - name: Release binaries
uses: https://gitea.com/actions/release-action@main uses: https://gitea.com/actions/release-action@main
with: with:

View File

@@ -2,5 +2,3 @@
Icon = "icon.png" Icon = "icon.png"
Name = "Swiped Mod Switcher" Name = "Swiped Mod Switcher"
ID = "com.s1d3sw1ped.swipedmodswitcher" ID = "com.s1d3sw1ped.swipedmodswitcher"
Version = "0.0.0"
Build = 2

View File

@@ -1,5 +1,5 @@
# Swiped Mod Switcher # Swiped Mod Switcher
A simple but effective mod switcher for simple game such as Sims and Cyberpunk 2077. A simple but effective mod switcher for simple game such as Sims.
it works by switching out a games mod folder with one of the ones made by you and placed under the profiles directory. it works by switching out a games mod folder with one of the ones made by you and placed under the profiles directory.

32
main.go
View File

@@ -4,9 +4,9 @@ import (
"fmt" "fmt"
"os" "os"
"path/filepath" "path/filepath"
"runtime/debug"
"s1d3sw1ped/swipedmodswitcher/admin" "s1d3sw1ped/swipedmodswitcher/admin"
"slices" "slices"
"strconv"
"strings" "strings"
"fyne.io/fyne/v2" "fyne.io/fyne/v2"
@@ -18,8 +18,6 @@ import (
"gopkg.in/yaml.v3" "gopkg.in/yaml.v3"
) )
var Version = ""
type Config struct { type Config struct {
ModProfilesDirectory string `yaml:"mod_profiles_dir"` ModProfilesDirectory string `yaml:"mod_profiles_dir"`
GameModsDirectory string `yaml:"game_mods_dir"` GameModsDirectory string `yaml:"game_mods_dir"`
@@ -74,7 +72,31 @@ func main() {
cfg = loadConfig() cfg = loadConfig()
ap := app.New() ap := app.New()
wp := ap.NewWindow(ap.Metadata().Name + " v" + ap.Metadata().Version + "." + strconv.Itoa(ap.Metadata().Build))
commithash := func() string {
if info, ok := debug.ReadBuildInfo(); ok {
for _, setting := range info.Settings {
if setting.Key == "vcs.revision" {
return setting.Value
}
}
}
return ""
}()
buildversion := ap.Metadata().Custom["BuildVersion"]
if buildversion == "" {
buildversion = ""
}
buildnumber := ap.Metadata().Custom["BuildNumber"]
if buildnumber == "" {
buildnumber = "commit " + commithash
} else {
buildnumber = "build " + buildnumber
}
wp := ap.NewWindow(ap.Metadata().Name + " " + buildversion + " " + buildnumber)
wp.Resize(fyne.NewSize(600, 1)) wp.Resize(fyne.NewSize(600, 1))
wp.CenterOnScreen() wp.CenterOnScreen()
@@ -189,6 +211,6 @@ func makeIFunc(profile, archive string, parent fyne.Window) func() {
return return
} }
dialog.NewInformation("Success", fmt.Sprintf("filinked files from %s to %s", filepath.Base(profile), archive), parent).Show() dialog.NewInformation("Success", fmt.Sprintf("linked files from %s to %s", filepath.Base(profile), archive), parent).Show()
} }
} }