diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 35746b7..a635463 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -7,6 +7,7 @@ on: jobs: build: + name: artifact builds on linux and windows env: RUNNER_TOOL_CACHE: /toolcache runs-on: ubuntu-latest @@ -23,7 +24,28 @@ jobs: apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev - name: build-linux - run: GOOS=linux GOARCH=amd64 CGO_ENABLED=1 CC=gcc go build -v -ldflags="-s -w -X 'main.Version=${{github.ref_name}}'" -o bin/sw1ped-mod-switcher-${{github.ref_name}}-linux-amd64 - - #- name: build-windows - # run: GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw64-gcc go build -v -ldflags="-s -w -X 'main.Version=${{github.ref_name}}'" -o bin/sw1ped-mod-switcher-${{github.ref_name}}-windows-amd64.exe + run: | + VERSION=${{github.ref_name}} + BUILD=${{github.run_number}} + GOOS=windows + GOARCH=amd64 + GOFLAGS="-ldflags=-s -ldflags=-w" + CGO_ENABLED=1 + CC=gcc + fyne package --appVersion=${VERSION} --appBuild=${BUILD} --exe bin/swiped-mod-switcher-$VERSION-linux-amd64 main.go + + - name: build-windows + run: | + VERSION=${{github.ref_name}} + BUILD=${{github.run_number}} + GOOS=windows + GOARCH=amd64 + GOFLAGS="-ldflags=-H=windowsgui -ldflags=-s -ldflags=-w" + CGO_ENABLED=1 + CC=x86_64-w64-mingw32-gcc + fyne package --appVersion=${VERSION} --appBuild=${BUILD} --exe bin/swiped-mod-switcher-$VERSION-windows-amd64.exe main.go + + - uses: actions/upload-artifact@v3 + with: + name: swiped-mod-switcher-${{github.ref_name}} + path: bin/ \ No newline at end of file diff --git a/.gitea/workflows/pr-validation.yaml b/.gitea/workflows/pr-validation.yaml index 6bdb3fe..dc675c4 100644 --- a/.gitea/workflows/pr-validation.yaml +++ b/.gitea/workflows/pr-validation.yaml @@ -7,7 +7,7 @@ on: jobs: build: - name: Build and Test Vulture + name: build and run tests env: RUNNER_TOOL_CACHE: /toolcache runs-on: ubuntu-latest @@ -18,21 +18,29 @@ jobs: - uses: actions/setup-go@v5 with: go-version-file: 'go.mod' - - name: setup-dependencies + - name: setup dependencies run: | apt-get update apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev - - name: Build - run: go build -v ./... - - name: Run Tests + - name: build + run: | + VERSION=${{github.ref_name}} + BUILD=${{github.run_number}} + GOOS=linux + GOARCH=amd64 + GOFLAGS="-ldflags=-s -ldflags=-w" + CGO_ENABLED=1 + CC=gcc + fyne package --appVersion=${VERSION} --appBuild=${BUILD} --exe bin/swiped-mod-switcher-${VERSION}.${BUILD}-linux-amd64 main.go + - name: run tests run: go test -v ./... - name: Check Vet run: go vet ./... - - name: Check Formatting + - name: check formatting run: |- gofmt -s -l . if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi - - name: Check Lint + - name: check lint uses: golangci/golangci-lint-action@v3 with: version: latest \ No newline at end of file diff --git a/.gitea/workflows/release-tag.yaml b/.gitea/workflows/release-tag.yaml index 038d965..314911a 100644 --- a/.gitea/workflows/release-tag.yaml +++ b/.gitea/workflows/release-tag.yaml @@ -1,9 +1,8 @@ -name: release - -on: +name: release-tag +on: push: tags: - - '*' + - 'v*' jobs: release: @@ -19,13 +18,30 @@ jobs: run: | apt-get update apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev - - name: release-build-linux - run: GOOS=linux GOARCH=amd64 go build -ldflags="-s -w -X 's1d3sw1ped/vulture/config.BuildVersion=${{github.ref_name}}'" -o bin/vulture-${{github.ref_name}}-linux-amd64 - - name: release-build-windows - run: GOOS=windows GOARCH=amd64 go build -ldflags="-s -w -X 's1d3sw1ped/vulture/config.BuildVersion=${{github.ref_name}}'" -o bin/vulture-${{github.ref_name}}-windows-amd64.exe - - name: release-build-darwin - run: GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w -X 's1d3sw1ped/vulture/config.BuildVersion=${{github.ref_name}}'" -o bin/vulture-${{github.ref_name}}-darwin-amd64 - - name: update-release + + - name: build-linux + run: | + VERSION=${{github.ref_name}} + BUILD=${{github.run_number}} + GOOS=linux + GOARCH=amd64 + GOFLAGS="-ldflags=-s -ldflags=-w" + CGO_ENABLED=1 + CC=gcc + fyne package --appVersion=${VERSION} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION#v}.${BUILD}-linux-amd64 main.go + + - name: build-windows + run: | + VERSION=${{github.ref_name}} + BUILD=${{github.run_number}} + GOOS=windows + GOARCH=amd64 + GOFLAGS="-ldflags=-H=windowsgui -ldflags=-s -ldflags=-w" + CGO_ENABLED=1 + CC=x86_64-w64-mingw32-gcc + fyne package --appVersion=${VERSION} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION#v}.${BUILD}-windows-amd64.exe main.go + + - name: add-release-binaries uses: https://gitea.com/actions/release-action@main with: files: |- diff --git a/FyneApp.toml b/FyneApp.toml new file mode 100644 index 0000000..783ba0f --- /dev/null +++ b/FyneApp.toml @@ -0,0 +1,6 @@ +[Details] +Icon = "icon.png" +Name = "Swiped Mod Switcher" +ID = "com.s1d3sw1ped.swipedmodswitcher" +Version = "untracked" +Build = 1 \ No newline at end of file diff --git a/README.md b/README.md index d101ce2..11e3938 100644 --- a/README.md +++ b/README.md @@ -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. \ No newline at end of file diff --git a/main.go b/main.go index 4c7a003..09c19c1 100644 --- a/main.go +++ b/main.go @@ -6,6 +6,7 @@ import ( "path/filepath" "s1d3sw1ped/swipedmodswitcher/admin" "slices" + "strconv" "strings" "fyne.io/fyne/v2" @@ -69,7 +70,7 @@ func main() { cfg = loadConfig() ap := app.New() - wp := ap.NewWindow("Swiped Mod Switcher") + wp := ap.NewWindow(ap.Metadata().Name + " v" + ap.Metadata().Version + "." + strconv.Itoa(ap.Metadata().Build)) wp.Resize(fyne.NewSize(600, 1)) wp.CenterOnScreen()