From 8e2cfc67e38a5a51e702a1b4939a05c7d0ab62e4 Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 10 Mar 2024 00:42:36 -0600 Subject: [PATCH 01/28] add actions --- .gitea/workflows/build.yaml | 28 ++++++++++++++++++++++ .gitea/workflows/pr-validation.yaml | 37 +++++++++++++++++++++++++++++ .gitea/workflows/release-tag.yaml | 32 +++++++++++++++++++++++++ build.cmd | 1 - 4 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 .gitea/workflows/build.yaml create mode 100644 .gitea/workflows/pr-validation.yaml create mode 100644 .gitea/workflows/release-tag.yaml delete mode 100644 build.cmd diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..9c297bb --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,28 @@ +name: Build and Artifact Vulture +on: + push: + branches: + - "master" + - "develop" + +jobs: + build: + env: + RUNNER_TOOL_CACHE: /toolcache + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + - name: setup-dependencies + run: | + apt install mingw-w64 gcc + - 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 \ No newline at end of file diff --git a/.gitea/workflows/pr-validation.yaml b/.gitea/workflows/pr-validation.yaml new file mode 100644 index 0000000..07acf91 --- /dev/null +++ b/.gitea/workflows/pr-validation.yaml @@ -0,0 +1,37 @@ +name: PR Validation +on: + pull_request: + branches: + - master + - develop + +jobs: + build: + name: Build and Test Vulture + env: + RUNNER_TOOL_CACHE: /toolcache + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + - name: setup-dependencies + run: | + apt install mingw-w64 gcc + - name: Build + run: go build -v ./... + - name: Run Tests + run: go test -v ./... + - name: Check Vet + run: go vet ./... + - name: Check Formatting + run: | + gofmt -s -l . + if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi + - 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 new file mode 100644 index 0000000..119c484 --- /dev/null +++ b/.gitea/workflows/release-tag.yaml @@ -0,0 +1,32 @@ +name: release + +on: + push: + tags: + - '*' + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + - name: setup-dependencies + run: | + apt install mingw-w64 gcc + - 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 + uses: https://gitea.com/actions/release-action@main + with: + files: |- + bin/** + api_key: '${{secrets.RELEASE_TOKEN}}' diff --git a/build.cmd b/build.cmd deleted file mode 100644 index 6757e4e..0000000 --- a/build.cmd +++ /dev/null @@ -1 +0,0 @@ -fyne package -os windows -icon .\cpms.png \ No newline at end of file From 62e66751d8bab461d82ddd23c77206afd4f4c254 Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 10 Mar 2024 00:45:16 -0600 Subject: [PATCH 02/28] fix --- .gitea/workflows/build.yaml | 6 ++++-- .gitea/workflows/pr-validation.yaml | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 9c297bb..f7544de 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -19,10 +19,12 @@ jobs: go-version-file: 'go.mod' - name: setup-dependencies run: | - apt install mingw-w64 gcc + apt install mingw-w64 gcc; + - 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 \ No newline at end of file + 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 diff --git a/.gitea/workflows/pr-validation.yaml b/.gitea/workflows/pr-validation.yaml index 07acf91..9e14807 100644 --- a/.gitea/workflows/pr-validation.yaml +++ b/.gitea/workflows/pr-validation.yaml @@ -30,7 +30,8 @@ jobs: - name: Check Formatting run: | gofmt -s -l . - if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi + if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi + - name: Check Lint uses: golangci/golangci-lint-action@v3 with: From 9c8043261109a9dabd75ec7f4ddf5a7259934d88 Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 10 Mar 2024 00:47:30 -0600 Subject: [PATCH 03/28] fix again --- .gitea/workflows/build.yaml | 9 +++------ .gitea/workflows/pr-validation.yaml | 1 - 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index f7544de..d1d05b8 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -18,13 +18,10 @@ jobs: with: go-version-file: 'go.mod' - name: setup-dependencies - run: | - apt install mingw-w64 gcc; + run: apt install mingw-w64 gcc - 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 + 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: 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 diff --git a/.gitea/workflows/pr-validation.yaml b/.gitea/workflows/pr-validation.yaml index 9e14807..c7fabb8 100644 --- a/.gitea/workflows/pr-validation.yaml +++ b/.gitea/workflows/pr-validation.yaml @@ -31,7 +31,6 @@ jobs: run: | gofmt -s -l . if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi - - name: Check Lint uses: golangci/golangci-lint-action@v3 with: From a5655abe767a09da69520962b571ce3a862ef4ad Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 10 Mar 2024 00:50:11 -0600 Subject: [PATCH 04/28] maybe found problem --- .gitea/workflows/pr-validation.yaml | 10 +++++----- .gitea/workflows/release-tag.yaml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/pr-validation.yaml b/.gitea/workflows/pr-validation.yaml index c7fabb8..b4b9e3f 100644 --- a/.gitea/workflows/pr-validation.yaml +++ b/.gitea/workflows/pr-validation.yaml @@ -19,8 +19,8 @@ jobs: with: go-version-file: 'go.mod' - name: setup-dependencies - run: | - apt install mingw-w64 gcc + run: |- + apt install mingw-w64 gcc - name: Build run: go build -v ./... - name: Run Tests @@ -28,9 +28,9 @@ jobs: - name: Check Vet run: go vet ./... - name: Check Formatting - run: | - gofmt -s -l . - if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi + run: |- + gofmt -s -l . + if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi - name: Check Lint uses: golangci/golangci-lint-action@v3 with: diff --git a/.gitea/workflows/release-tag.yaml b/.gitea/workflows/release-tag.yaml index 119c484..088de34 100644 --- a/.gitea/workflows/release-tag.yaml +++ b/.gitea/workflows/release-tag.yaml @@ -17,7 +17,7 @@ jobs: go-version-file: 'go.mod' - name: setup-dependencies run: | - apt install mingw-w64 gcc + apt install mingw-w64 gcc - 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 From f1e9961bdd94a7014f26b4e3a8d4c5a923e7fb3f Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 10 Mar 2024 00:53:11 -0600 Subject: [PATCH 05/28] mingw was not found might need to apt update first --- .gitea/workflows/build.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index d1d05b8..1effbfc 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -18,7 +18,9 @@ jobs: with: go-version-file: 'go.mod' - name: setup-dependencies - run: apt install mingw-w64 gcc + run: | + apt update + apt install mingw-w64 gcc - 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 From bc478e4702600b02b236efc8e759af24ef0bbf59 Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 10 Mar 2024 01:02:19 -0600 Subject: [PATCH 06/28] maybe now --- .gitea/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 1effbfc..1f0b575 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -20,7 +20,7 @@ jobs: - name: setup-dependencies run: | apt update - apt install mingw-w64 gcc + apt install gcc-mingw-w64 gcc - 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 From 8eb82dd20455444101f7a2a1cd6831dc5b7a55f1 Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 10 Mar 2024 01:04:33 -0600 Subject: [PATCH 07/28] getting somewhere --- .gitea/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 1f0b575..8b72abd 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -19,8 +19,8 @@ jobs: go-version-file: 'go.mod' - name: setup-dependencies run: | - apt update - apt install gcc-mingw-w64 gcc + apt-get update + apt-get install -y gcc-mingw-w64 gcc - 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 From 64abc1825652ee78d314238252b33a0a77b68dca Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 10 Mar 2024 01:09:53 -0600 Subject: [PATCH 08/28] add more deps --- .gitea/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 8b72abd..7e086b2 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -20,7 +20,7 @@ jobs: - name: setup-dependencies run: | apt-get update - apt-get install -y gcc-mingw-w64 gcc + 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 From b9379f9d668316d04325f1d4f6685d765e82fee1 Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 10 Mar 2024 01:16:34 -0600 Subject: [PATCH 09/28] windows build disabled for now and deps are correct on all now --- .gitea/workflows/build.yaml | 5 ++--- .gitea/workflows/pr-validation.yaml | 4 ++-- .gitea/workflows/release-tag.yaml | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 7e086b2..ffcc0dd 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -19,11 +19,10 @@ jobs: go-version-file: 'go.mod' - name: setup-dependencies run: | - apt-get update 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 + #- 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 diff --git a/.gitea/workflows/pr-validation.yaml b/.gitea/workflows/pr-validation.yaml index b4b9e3f..6d110fa 100644 --- a/.gitea/workflows/pr-validation.yaml +++ b/.gitea/workflows/pr-validation.yaml @@ -19,8 +19,8 @@ jobs: with: go-version-file: 'go.mod' - name: setup-dependencies - run: |- - apt install mingw-w64 gcc + run: | + apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev - name: Build run: go build -v ./... - name: Run Tests diff --git a/.gitea/workflows/release-tag.yaml b/.gitea/workflows/release-tag.yaml index 088de34..785e5c8 100644 --- a/.gitea/workflows/release-tag.yaml +++ b/.gitea/workflows/release-tag.yaml @@ -17,7 +17,7 @@ jobs: go-version-file: 'go.mod' - name: setup-dependencies run: | - apt install mingw-w64 gcc + 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 From 08baf8e1dafbcb377fa36c914b100b2d909d003e Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 10 Mar 2024 01:20:23 -0600 Subject: [PATCH 10/28] rename actions --- .gitea/workflows/build.yaml | 2 +- .gitea/workflows/pr-validation.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index ffcc0dd..9f5f9a4 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -1,4 +1,4 @@ -name: Build and Artifact Vulture +name: build and test on: push: branches: diff --git a/.gitea/workflows/pr-validation.yaml b/.gitea/workflows/pr-validation.yaml index 6d110fa..6bb2772 100644 --- a/.gitea/workflows/pr-validation.yaml +++ b/.gitea/workflows/pr-validation.yaml @@ -1,4 +1,4 @@ -name: PR Validation +name: pull request validation on: pull_request: branches: From 32174bfb41ea0cc74545e9178504ece4e5bd4a3e Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 10 Mar 2024 01:22:53 -0600 Subject: [PATCH 11/28] update was necessary --- .gitea/workflows/build.yaml | 1 + .gitea/workflows/pr-validation.yaml | 1 + .gitea/workflows/release-tag.yaml | 1 + 3 files changed, 3 insertions(+) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 9f5f9a4..35746b7 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -19,6 +19,7 @@ jobs: go-version-file: 'go.mod' - name: setup-dependencies run: | + apt-get update apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev - name: build-linux diff --git a/.gitea/workflows/pr-validation.yaml b/.gitea/workflows/pr-validation.yaml index 6bb2772..6bdb3fe 100644 --- a/.gitea/workflows/pr-validation.yaml +++ b/.gitea/workflows/pr-validation.yaml @@ -20,6 +20,7 @@ jobs: go-version-file: 'go.mod' - 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 ./... diff --git a/.gitea/workflows/release-tag.yaml b/.gitea/workflows/release-tag.yaml index 785e5c8..038d965 100644 --- a/.gitea/workflows/release-tag.yaml +++ b/.gitea/workflows/release-tag.yaml @@ -17,6 +17,7 @@ jobs: go-version-file: 'go.mod' - name: setup-dependencies 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 From f5c621f808458c5c784cf7a4f6713a29564b6152 Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 10 Mar 2024 10:54:16 -0500 Subject: [PATCH 12/28] see if this makes windows builds work --- .gitea/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 35746b7..f7d2448 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -25,5 +25,5 @@ jobs: - 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 + - name: build-windows + run: GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc go build -v -ldflags="-s -w -X 'main.Version=${{github.ref_name}}'" -o bin/sw1ped-mod-switcher-${{github.ref_name}}-windows-amd64.exe From 60e7e9e506bdc944154ddfbecf06a425a0f3fd2e Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 10 Mar 2024 13:31:11 -0500 Subject: [PATCH 13/28] add FyneApp.toml --- FyneApp.toml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 FyneApp.toml 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 From 4da5f46fdddffb64dcb92f426124ef6ebf5c35d0 Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 10 Mar 2024 13:31:22 -0500 Subject: [PATCH 14/28] add disclaimer to README --- README.md | 3 +++ 1 file changed, 3 insertions(+) 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 From 63c58712757961377d7b18a9e38b7c40c60e2348 Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 10 Mar 2024 13:31:49 -0500 Subject: [PATCH 15/28] add version info to window title --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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() From 875202ceb4ffb1c2d320426634b89a9baa8a5d3f Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 10 Mar 2024 13:32:21 -0500 Subject: [PATCH 16/28] should be working builds --- .gitea/workflows/build.yaml | 28 ++++++++++++++++++--- .gitea/workflows/pr-validation.yaml | 22 +++++++++++------ .gitea/workflows/release-tag.yaml | 38 ++++++++++++++++++++--------- 3 files changed, 67 insertions(+), 21 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index f7d2448..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 - + 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: GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-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=-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: |- From aaeaebdb030bcd49fed2fe93403d050a1b477a99 Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 10 Mar 2024 13:38:24 -0500 Subject: [PATCH 17/28] have to get fyne aswell --- .gitea/workflows/build.yaml | 9 +++++++-- .gitea/workflows/pr-validation.yaml | 6 ++++++ .gitea/workflows/release-tag.yaml | 5 +++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index a635463..5c93e9e 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -23,7 +23,12 @@ jobs: apt-get update apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev - - name: build-linux + - name: get fyne + run: | + go get fyne.io/fyne/v2@latest + go install fyne.io/fyne/v2/cmd/fyne@latest + + - name: build linux run: | VERSION=${{github.ref_name}} BUILD=${{github.run_number}} @@ -34,7 +39,7 @@ jobs: CC=gcc fyne package --appVersion=${VERSION} --appBuild=${BUILD} --exe bin/swiped-mod-switcher-$VERSION-linux-amd64 main.go - - name: build-windows + - name: build windows run: | VERSION=${{github.ref_name}} BUILD=${{github.run_number}} diff --git a/.gitea/workflows/pr-validation.yaml b/.gitea/workflows/pr-validation.yaml index dc675c4..a18127e 100644 --- a/.gitea/workflows/pr-validation.yaml +++ b/.gitea/workflows/pr-validation.yaml @@ -22,6 +22,12 @@ jobs: run: | apt-get update apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev + + - name: get fyne + run: | + go get fyne.io/fyne/v2@latest + go install fyne.io/fyne/v2/cmd/fyne@latest + - name: build run: | VERSION=${{github.ref_name}} diff --git a/.gitea/workflows/release-tag.yaml b/.gitea/workflows/release-tag.yaml index 314911a..e72da4b 100644 --- a/.gitea/workflows/release-tag.yaml +++ b/.gitea/workflows/release-tag.yaml @@ -19,6 +19,11 @@ jobs: apt-get update apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev + - name: get fyne + run: | + go get fyne.io/fyne/v2@latest + go install fyne.io/fyne/v2/cmd/fyne@latest + - name: build-linux run: | VERSION=${{github.ref_name}} From d10d83dd052cdcaa5714ae6e525d0a9eccf33155 Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 10 Mar 2024 13:47:37 -0500 Subject: [PATCH 18/28] really fyne why is version so specific --- .gitea/workflows/build.yaml | 10 ++++++---- .gitea/workflows/pr-validation.yaml | 8 +++++--- .gitea/workflows/release-tag.yaml | 16 +++++++++------- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 5c93e9e..a5a8ecf 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -12,10 +12,12 @@ jobs: RUNNER_TOOL_CACHE: /toolcache runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: checkout + uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-go@v5 + - name: setup go + uses: actions/setup-go@v5 with: go-version-file: 'go.mod' - name: setup-dependencies @@ -37,7 +39,7 @@ jobs: 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 + fyne package --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/swiped-mod-switcher-$VERSION-linux-amd64 main.go - name: build windows run: | @@ -48,7 +50,7 @@ jobs: 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 + fyne package --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/swiped-mod-switcher-$VERSION-windows-amd64.exe main.go - uses: actions/upload-artifact@v3 with: diff --git a/.gitea/workflows/pr-validation.yaml b/.gitea/workflows/pr-validation.yaml index a18127e..17d034e 100644 --- a/.gitea/workflows/pr-validation.yaml +++ b/.gitea/workflows/pr-validation.yaml @@ -12,10 +12,12 @@ jobs: RUNNER_TOOL_CACHE: /toolcache runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: checkout + uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-go@v5 + - name: setup go + uses: actions/setup-go@v5 with: go-version-file: 'go.mod' - name: setup dependencies @@ -37,7 +39,7 @@ jobs: 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 + fyne package --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/swiped-mod-switcher-${VERSION}.${BUILD}-linux-amd64 main.go - name: run tests run: go test -v ./... - name: Check Vet diff --git a/.gitea/workflows/release-tag.yaml b/.gitea/workflows/release-tag.yaml index e72da4b..4927422 100644 --- a/.gitea/workflows/release-tag.yaml +++ b/.gitea/workflows/release-tag.yaml @@ -8,10 +8,12 @@ jobs: release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: checkout + uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-go@v5 + - name: setup go + uses: actions/setup-go@v5 with: go-version-file: 'go.mod' - name: setup-dependencies @@ -24,7 +26,7 @@ jobs: go get fyne.io/fyne/v2@latest go install fyne.io/fyne/v2/cmd/fyne@latest - - name: build-linux + - name: build linux run: | VERSION=${{github.ref_name}} BUILD=${{github.run_number}} @@ -33,9 +35,9 @@ jobs: 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 + fyne package --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION}.${BUILD}-linux-amd64 main.go - - name: build-windows + - name: build windows run: | VERSION=${{github.ref_name}} BUILD=${{github.run_number}} @@ -44,9 +46,9 @@ jobs: 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 + fyne package --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION}.${BUILD}-windows-amd64.exe main.go - - name: add-release-binaries + - name: add release binaries uses: https://gitea.com/actions/release-action@main with: files: |- From cad13efe95db622b95dae4fa74acd8a8047d674d Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 10 Mar 2024 13:57:50 -0500 Subject: [PATCH 19/28] okay fyne --- .gitea/workflows/build.yaml | 6 ++---- .gitea/workflows/pr-validation.yaml | 4 +--- FyneApp.toml | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index a5a8ecf..64a1fd9 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -32,25 +32,23 @@ jobs: - name: build linux 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#v} --appBuild=${BUILD} --exe bin/swiped-mod-switcher-$VERSION-linux-amd64 main.go + fyne package --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#v} --appBuild=${BUILD} --exe bin/swiped-mod-switcher-$VERSION-windows-amd64.exe main.go + fyne package --appBuild=${BUILD} --exe bin/swiped-mod-switcher-$VERSION-windows-amd64.exe main.go - uses: actions/upload-artifact@v3 with: diff --git a/.gitea/workflows/pr-validation.yaml b/.gitea/workflows/pr-validation.yaml index 17d034e..983834d 100644 --- a/.gitea/workflows/pr-validation.yaml +++ b/.gitea/workflows/pr-validation.yaml @@ -32,14 +32,12 @@ jobs: - 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#v} --appBuild=${BUILD} --exe bin/swiped-mod-switcher-${VERSION}.${BUILD}-linux-amd64 main.go + fyne package --exe bin/swiped-mod-switcher-${VERSION}.${BUILD}-linux-amd64 main.go - name: run tests run: go test -v ./... - name: Check Vet diff --git a/FyneApp.toml b/FyneApp.toml index 783ba0f..3ec3d4a 100644 --- a/FyneApp.toml +++ b/FyneApp.toml @@ -2,5 +2,5 @@ Icon = "icon.png" Name = "Swiped Mod Switcher" ID = "com.s1d3sw1ped.swipedmodswitcher" -Version = "untracked" +Version = "0.0.0" Build = 1 \ No newline at end of file From 95caed9b33616d83bbeb0ac183776865e7db8b84 Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 10 Mar 2024 14:04:10 -0500 Subject: [PATCH 20/28] fyne cant follow golangs example with getting deps for builds --- .gitea/workflows/build.yaml | 3 +++ .gitea/workflows/pr-validation.yaml | 3 +++ .gitea/workflows/release-tag.yaml | 3 +++ 3 files changed, 9 insertions(+) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 64a1fd9..08579ad 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -30,6 +30,9 @@ jobs: go get fyne.io/fyne/v2@latest go install fyne.io/fyne/v2/cmd/fyne@latest + - name: go mod + run: go mod tidy + - name: build linux run: | BUILD=${{github.run_number}} diff --git a/.gitea/workflows/pr-validation.yaml b/.gitea/workflows/pr-validation.yaml index 983834d..92506ec 100644 --- a/.gitea/workflows/pr-validation.yaml +++ b/.gitea/workflows/pr-validation.yaml @@ -30,6 +30,9 @@ jobs: go get fyne.io/fyne/v2@latest go install fyne.io/fyne/v2/cmd/fyne@latest + - name: go mod + run: go mod tidy + - name: build run: | GOOS=linux diff --git a/.gitea/workflows/release-tag.yaml b/.gitea/workflows/release-tag.yaml index 4927422..86d1f9d 100644 --- a/.gitea/workflows/release-tag.yaml +++ b/.gitea/workflows/release-tag.yaml @@ -26,6 +26,9 @@ jobs: go get fyne.io/fyne/v2@latest go install fyne.io/fyne/v2/cmd/fyne@latest + - name: go mod + run: go mod tidy + - name: build linux run: | VERSION=${{github.ref_name}} From 8de631afa2d92204d8151619d4d1fa5528b0ebb3 Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 10 Mar 2024 15:12:00 -0500 Subject: [PATCH 21/28] no need to checkout the entire repo --- .gitea/workflows/build.yaml | 3 --- .gitea/workflows/pr-validation.yaml | 2 -- .gitea/workflows/release-tag.yaml | 2 -- 3 files changed, 7 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 08579ad..da1b938 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -3,7 +3,6 @@ on: push: branches: - "master" - - "develop" jobs: build: @@ -14,8 +13,6 @@ jobs: steps: - name: checkout uses: actions/checkout@v4 - with: - fetch-depth: 0 - name: setup go uses: actions/setup-go@v5 with: diff --git a/.gitea/workflows/pr-validation.yaml b/.gitea/workflows/pr-validation.yaml index 92506ec..c0752a5 100644 --- a/.gitea/workflows/pr-validation.yaml +++ b/.gitea/workflows/pr-validation.yaml @@ -14,8 +14,6 @@ jobs: steps: - name: checkout uses: actions/checkout@v4 - with: - fetch-depth: 0 - name: setup go uses: actions/setup-go@v5 with: diff --git a/.gitea/workflows/release-tag.yaml b/.gitea/workflows/release-tag.yaml index 86d1f9d..11b1630 100644 --- a/.gitea/workflows/release-tag.yaml +++ b/.gitea/workflows/release-tag.yaml @@ -10,8 +10,6 @@ jobs: steps: - name: checkout uses: actions/checkout@v4 - with: - fetch-depth: 0 - name: setup go uses: actions/setup-go@v5 with: From 4c1de974f0afd935f4ba308e1a4a9b245fe8243d Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 10 Mar 2024 16:10:59 -0500 Subject: [PATCH 22/28] major ci change --- .gitea/workflows/build.yaml | 56 --------------- .gitea/workflows/ci.yaml | 104 ++++++++++++++++++++++++++++ .gitea/workflows/pr-validation.yaml | 53 -------------- .gitea/workflows/release-tag.yaml | 32 ++++----- 4 files changed, 119 insertions(+), 126 deletions(-) delete mode 100644 .gitea/workflows/build.yaml create mode 100644 .gitea/workflows/ci.yaml delete mode 100644 .gitea/workflows/pr-validation.yaml diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml deleted file mode 100644 index da1b938..0000000 --- a/.gitea/workflows/build.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: build and test -on: - push: - branches: - - "master" - -jobs: - build: - name: artifact builds on linux and windows - 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' - - name: setup-dependencies - run: | - apt-get update - apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev - - - name: get fyne - run: | - go get fyne.io/fyne/v2@latest - go install fyne.io/fyne/v2/cmd/fyne@latest - - - name: go mod - run: go mod tidy - - - name: build linux - run: | - BUILD=${{github.run_number}} - GOOS=windows - GOARCH=amd64 - GOFLAGS="-ldflags=-s -ldflags=-w" - CGO_ENABLED=1 - CC=gcc - fyne package --appBuild=${BUILD} --exe bin/swiped-mod-switcher-$VERSION-linux-amd64 main.go - - - name: build windows - run: | - 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 --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/ci.yaml b/.gitea/workflows/ci.yaml new file mode 100644 index 0000000..a83a1a9 --- /dev/null +++ b/.gitea/workflows/ci.yaml @@ -0,0 +1,104 @@ +name: CI +on: + push: + branches: [master, develop] + 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: Lint + uses: golangci/golangci-lint-action@v3 + with: + version: latest + args: --verbose + + 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: 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: gcc + + - name: Upload artifact + 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 deleted file mode 100644 index c0752a5..0000000 --- a/.gitea/workflows/pr-validation.yaml +++ /dev/null @@ -1,53 +0,0 @@ -name: pull request validation -on: - pull_request: - branches: - - master - - develop - -jobs: - build: - name: build and run tests - 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' - - name: setup dependencies - run: | - apt-get update - apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev - - - name: get fyne - run: | - go get fyne.io/fyne/v2@latest - go install fyne.io/fyne/v2/cmd/fyne@latest - - - name: go mod - run: go mod tidy - - - name: build - run: | - GOOS=linux - GOARCH=amd64 - GOFLAGS="-ldflags=-s -ldflags=-w" - CGO_ENABLED=1 - CC=gcc - fyne package --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 - run: |- - gofmt -s -l . - if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi - - 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 11b1630..9af8d8b 100644 --- a/.gitea/workflows/release-tag.yaml +++ b/.gitea/workflows/release-tag.yaml @@ -1,4 +1,4 @@ -name: release-tag +name: Release versioned tag on: push: tags: @@ -6,52 +6,50 @@ on: jobs: release: + name: Build versioned release runs-on: ubuntu-latest steps: - - name: checkout + - name: Checkout uses: actions/checkout@v4 - - name: setup go + + - name: Setup go uses: actions/setup-go@v5 with: go-version-file: 'go.mod' - - name: setup-dependencies + + - name: Setup OS dependencies run: | apt-get update apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev - - name: get fyne + - name: Install fyne command run: | - go get fyne.io/fyne/v2@latest go install fyne.io/fyne/v2/cmd/fyne@latest - - name: go mod + - name: Install go dependencies run: go mod tidy - - name: build linux + - name: Build for 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#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION}.${BUILD}-linux-amd64 main.go + fyne package --os linux --release --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION}.${BUILD}-linux-amd64 main.go - - name: build windows + - name: Build for 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#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION}.${BUILD}-windows-amd64.exe main.go + fyne package --os windows --release --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION}.${BUILD}-windows-amd64.exe main.go - - name: add release binaries + - name: Release binaries uses: https://gitea.com/actions/release-action@main with: files: |- - bin/** + bin/** api_key: '${{secrets.RELEASE_TOKEN}}' From 57d8c1b33012fd5bb1b290a55647e3e35f4db60d Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 10 Mar 2024 16:24:56 -0500 Subject: [PATCH 23/28] fix test and build ci --- .gitea/workflows/ci.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index a83a1a9..05f15b3 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -43,6 +43,19 @@ jobs: 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 ./... @@ -95,7 +108,7 @@ jobs: GOARCH: amd64 EXE: .exe CGO_ENABLED: 1 - CC: gcc + CC: x86_64-w64-mingw64-gcc - name: Upload artifact uses: actions/upload-artifact@v3 From 89dedb9870495c6a6c0e658a230d863d9cafcf3b Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 10 Mar 2024 16:36:44 -0500 Subject: [PATCH 24/28] oops --- .gitea/workflows/ci.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 05f15b3..4c54917 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -7,6 +7,13 @@ on: jobs: lint: name: Lint + permissions: + # Required: allow read access to the content for analysis. + contents: read + # Optional: allow read access to pull request. Use with `only-new-issues` option. + pull-requests: read + # Optional: Allow write access to checks to allow the action to annotate code in the PR. + checks: write env: RUNNER_TOOL_CACHE: /toolcache runs-on: ubuntu-latest @@ -108,7 +115,7 @@ jobs: GOARCH: amd64 EXE: .exe CGO_ENABLED: 1 - CC: x86_64-w64-mingw64-gcc + CC: x86_64-w64-mingw32-gcc - name: Upload artifact uses: actions/upload-artifact@v3 From 709a06ffe66d8370a5efe2a22caaf98f859dd9e6 Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 10 Mar 2024 17:01:08 -0500 Subject: [PATCH 25/28] more changes to ci --- .gitea/workflows/pull-request-ci.yaml | 117 ++++++++++++++++++ .gitea/workflows/{ci.yaml => push-ci.yaml} | 12 +- .../{release-tag.yaml => tag-release.yaml} | 56 +++++++++ 3 files changed, 176 insertions(+), 9 deletions(-) create mode 100644 .gitea/workflows/pull-request-ci.yaml rename .gitea/workflows/{ci.yaml => push-ci.yaml} (87%) rename .gitea/workflows/{release-tag.yaml => tag-release.yaml} (57%) diff --git a/.gitea/workflows/pull-request-ci.yaml b/.gitea/workflows/pull-request-ci.yaml new file mode 100644 index 0000000..08cacd7 --- /dev/null +++ b/.gitea/workflows/pull-request-ci.yaml @@ -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/ \ No newline at end of file diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/push-ci.yaml similarity index 87% rename from .gitea/workflows/ci.yaml rename to .gitea/workflows/push-ci.yaml index 4c54917..7b05566 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/push-ci.yaml @@ -2,18 +2,10 @@ name: CI on: push: branches: [master, develop] - pull_request: jobs: lint: name: Lint - permissions: - # Required: allow read access to the content for analysis. - contents: read - # Optional: allow read access to pull request. Use with `only-new-issues` option. - pull-requests: read - # Optional: Allow write access to checks to allow the action to annotate code in the PR. - checks: write env: RUNNER_TOOL_CACHE: /toolcache runs-on: ubuntu-latest @@ -28,11 +20,13 @@ jobs: check-latest: true cache: true + - name: Install go dependencies + run: go mod tidy + - name: Lint uses: golangci/golangci-lint-action@v3 with: version: latest - args: --verbose test: name: Test diff --git a/.gitea/workflows/release-tag.yaml b/.gitea/workflows/tag-release.yaml similarity index 57% rename from .gitea/workflows/release-tag.yaml rename to .gitea/workflows/tag-release.yaml index 9af8d8b..d189fb0 100644 --- a/.gitea/workflows/release-tag.yaml +++ b/.gitea/workflows/tag-release.yaml @@ -5,6 +5,62 @@ on: - '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 From 31f3df710a3d89cb0832f497df6280ea28a5a5aa Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 10 Mar 2024 17:06:37 -0500 Subject: [PATCH 26/28] fixed artifact version issue --- .gitea/workflows/push-ci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitea/workflows/push-ci.yaml b/.gitea/workflows/push-ci.yaml index 7b05566..f967709 100644 --- a/.gitea/workflows/push-ci.yaml +++ b/.gitea/workflows/push-ci.yaml @@ -93,6 +93,7 @@ jobs: run: | fyne package --appBuild=${BUILD} --exe bin/swiped-mod-switcher-${VERSION}.${BUILD}-${GOOS}-${GOARCH}${EXE} main.go env: + VERSION: ${{github.ref_name}} BUILD: ${{github.run_number}} GOOS: linux GOARCH: amd64 @@ -104,6 +105,7 @@ jobs: run: | fyne package --appBuild=${BUILD} --exe bin/swiped-mod-switcher-${VERSION}.${BUILD}-${GOOS}-${GOARCH}${EXE} main.go env: + VERSION: ${{github.ref_name}} BUILD: ${{github.run_number}} GOOS: windows GOARCH: amd64 From 7d37c75d64ba3b3612b70715bbd494f6e07d2dca Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 10 Mar 2024 17:08:56 -0500 Subject: [PATCH 27/28] switched tag-release to new style --- .gitea/workflows/tag-release.yaml | 32 +++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/.gitea/workflows/tag-release.yaml b/.gitea/workflows/tag-release.yaml index d189fb0..1f9ac88 100644 --- a/.gitea/workflows/tag-release.yaml +++ b/.gitea/workflows/tag-release.yaml @@ -87,21 +87,29 @@ jobs: - name: Build for linux run: | - VERSION=${{github.ref_name}} - BUILD=${{github.run_number}} - GOFLAGS="-ldflags=-s -ldflags=-w" - CGO_ENABLED=1 - CC=gcc - fyne package --os linux --release --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION}.${BUILD}-linux-amd64 main.go + fyne package --os linux --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: | - VERSION=${{github.ref_name}} - BUILD=${{github.run_number}} - GOFLAGS="-ldflags=-H=windowsgui -ldflags=-s -ldflags=-w" - CGO_ENABLED=1 - CC=x86_64-w64-mingw32-gcc - fyne package --os windows --release --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION}.${BUILD}-windows-amd64.exe main.go + fyne package --os windows --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 From fcb127ef058361ed28fee69fe05c19bd161b1e31 Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 10 Mar 2024 20:50:04 -0500 Subject: [PATCH 28/28] cleanup --- .gitea/workflows/push-ci.yaml | 4 ++-- .gitea/workflows/tag-release.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/push-ci.yaml b/.gitea/workflows/push-ci.yaml index f967709..abcae19 100644 --- a/.gitea/workflows/push-ci.yaml +++ b/.gitea/workflows/push-ci.yaml @@ -91,7 +91,7 @@ jobs: - name: Build for linux run: | - fyne package --appBuild=${BUILD} --exe bin/swiped-mod-switcher-${VERSION}.${BUILD}-${GOOS}-${GOARCH}${EXE} main.go + 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}} @@ -103,7 +103,7 @@ jobs: - name: Build for windows run: | - fyne package --appBuild=${BUILD} --exe bin/swiped-mod-switcher-${VERSION}.${BUILD}-${GOOS}-${GOARCH}${EXE} main.go + 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}} diff --git a/.gitea/workflows/tag-release.yaml b/.gitea/workflows/tag-release.yaml index 1f9ac88..76a993c 100644 --- a/.gitea/workflows/tag-release.yaml +++ b/.gitea/workflows/tag-release.yaml @@ -87,7 +87,7 @@ jobs: - name: Build for linux run: | - fyne package --os linux --release --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION#v}.${BUILD}-linux-amd64 main.go + 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}} @@ -100,7 +100,7 @@ jobs: - name: Build for windows run: | - fyne package --os windows --release --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION#v}.${BUILD}-windows-amd64.exe main.go + 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}}