Merge branch 'master' of ssh://git.s1d3sw1ped.com:2222/s1d3sw1ped/SwipedModSwitcher
All checks were successful
CI / Lint (push) Successful in 56s
CI / Build (push) Successful in 3m12s
CI / Test (push) Successful in 3m37s

This commit is contained in:
2024-03-10 21:23:53 -05:00
7 changed files with 367 additions and 2 deletions

View File

@@ -0,0 +1,117 @@
name: CI
on:
pull_request:
jobs:
lint:
name: Lint
env:
RUNNER_TOOL_CACHE: /toolcache
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: true
cache: true
- name: Install go dependencies
run: go mod tidy
- name: Lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
test:
name: Test
env:
RUNNER_TOOL_CACHE: /toolcache
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: 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: Get fyne command
run: |
go install fyne.io/fyne/v2/cmd/fyne@latest
- name: Get go dependencies
run: |
go mod tidy
- name: Test
run: go test -race -v -shuffle=on ./...
build:
name: Build
env:
RUNNER_TOOL_CACHE: /toolcache
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: 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: Get fyne command
run: |
go install fyne.io/fyne/v2/cmd/fyne@latest
- name: Get go dependencies
run: |
go mod tidy
- name: Build for linux
run: |
fyne package --appBuild=${BUILD} --exe bin/swiped-mod-switcher-${VERSION}.${BUILD}-${GOOS}-${GOARCH}${EXE} main.go
env:
BUILD: ${{github.run_number}}
GOOS: linux
GOARCH: amd64
EXE: ""
CGO_ENABLED: 1
CC: gcc
- name: Build for windows
run: |
fyne package --appBuild=${BUILD} --exe bin/swiped-mod-switcher-${VERSION}.${BUILD}-${GOOS}-${GOARCH}${EXE} main.go
env:
BUILD: ${{github.run_number}}
GOOS: windows
GOARCH: amd64
EXE: .exe
CGO_ENABLED: 1
CC: x86_64-w64-mingw32-gcc
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: swiped-mod-switcher-${{github.ref_name}}
path: bin/

View File

@@ -0,0 +1,120 @@
name: CI
on:
push:
branches: [master, develop]
jobs:
lint:
name: Lint
env:
RUNNER_TOOL_CACHE: /toolcache
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: true
cache: true
- name: Install go dependencies
run: go mod tidy
- name: Lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
test:
name: Test
env:
RUNNER_TOOL_CACHE: /toolcache
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: 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: Get fyne command
run: |
go install fyne.io/fyne/v2/cmd/fyne@latest
- name: Get go dependencies
run: |
go mod tidy
- name: Test
run: go test -race -v -shuffle=on ./...
build:
name: Build
env:
RUNNER_TOOL_CACHE: /toolcache
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: 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: Get fyne command
run: |
go install fyne.io/fyne/v2/cmd/fyne@latest
- name: Get go dependencies
run: |
go mod tidy
- name: Build for linux
run: |
fyne package --os ${{GOOS}} --release --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION#v}.${BUILD}-linux-amd64 main.go
env:
VERSION: ${{github.ref_name}}
BUILD: ${{github.run_number}}
GOOS: linux
GOARCH: amd64
EXE: ""
CGO_ENABLED: 1
CC: gcc
- name: Build for windows
run: |
fyne package --os ${{GOOS}} --release --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION#v}.${BUILD}-windows-amd64.exe main.go
env:
VERSION: ${{github.ref_name}}
BUILD: ${{github.run_number}}
GOOS: windows
GOARCH: amd64
EXE: .exe
CGO_ENABLED: 1
CC: x86_64-w64-mingw32-gcc
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: swiped-mod-switcher-${{github.ref_name}}
path: bin/

View File

@@ -0,0 +1,119 @@
name: Release versioned tag
on:
push:
tags:
- 'v*'
jobs:
lint:
name: Lint
env:
RUNNER_TOOL_CACHE: /toolcache
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: true
cache: true
- name: Install go dependencies
run: go mod tidy
- name: Lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
test:
name: Test
env:
RUNNER_TOOL_CACHE: /toolcache
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: 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: Get fyne command
run: |
go install fyne.io/fyne/v2/cmd/fyne@latest
- name: Get go dependencies
run: |
go mod tidy
- name: Test
run: go test -race -v -shuffle=on ./...
release:
name: Build versioned release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Setup OS dependencies
run: |
apt-get update
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
- name: Install fyne command
run: |
go install fyne.io/fyne/v2/cmd/fyne@latest
- name: Install go dependencies
run: go mod tidy
- name: Build for linux
run: |
fyne package --os ${{GOOS}} --release --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION#v}.${BUILD}-linux-amd64 main.go
env:
VERSION: ${{github.ref_name}}
BUILD: ${{github.run_number}}
GOOS: linux
GOARCH: amd64
EXE: ""
CGO_ENABLED: 1
CC: gcc
- name: Build for windows
run: |
fyne package --os ${{GOOS}} --release --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION#v}.${BUILD}-windows-amd64.exe main.go
env:
VERSION: ${{github.ref_name}}
BUILD: ${{github.run_number}}
GOOS: windows
GOARCH: amd64
EXE: ".exe"
CGO_ENABLED: 1
CC: x86_64-w64-mingw32-gcc
- name: Release binaries
uses: https://gitea.com/actions/release-action@main
with:
files: |-
bin/**
api_key: '${{secrets.RELEASE_TOKEN}}'

6
FyneApp.toml Normal file
View File

@@ -0,0 +1,6 @@
[Details]
Icon = "icon.png"
Name = "Swiped Mod Switcher"
ID = "com.s1d3sw1ped.swipedmodswitcher"
Version = "0.0.0"
Build = 1

View File

@@ -28,5 +28,8 @@ the switch is really just a symbolic link so it happens in milliseconds even on
7. Click Reload Mod Profiles and it should display your profile then simply click it to switch to that profile.
8. Play your game or create more profiles the choice at this point is yours.
## Disclaimer
No testing goes into ensuring the linux builds actually work.
## Virus Warning
There are alot of false positives with golang programs if you got a warning for this app it was 99% a false positive however if you believe that it may not be a false positive then either check with virustotal or delete it. there is basically nothing i can do to make your virus scanner not think its a virus and im not spending the years to call or email your virus scanner company to have them fix it. if it really bothers you then do that yourself.

View File

@@ -1 +0,0 @@
fyne package --os windows --icon .\cpms.png --exe SwipedModSwitcher

View File

@@ -6,6 +6,7 @@ import (
"path/filepath"
"s1d3sw1ped/swipedmodswitcher/admin"
"slices"
"strconv"
"strings"
"fyne.io/fyne/v2"
@@ -71,7 +72,7 @@ func main() {
cfg = loadConfig()
ap := app.New()
wp := ap.NewWindow("Swiped Mod Switcher " + Version)
wp := ap.NewWindow(ap.Metadata().Name + " v" + ap.Metadata().Version + "." + strconv.Itoa(ap.Metadata().Build))
wp.Resize(fyne.NewSize(600, 1))
wp.CenterOnScreen()