diff --git a/.gitea/workflows/pull-request-ci.yaml b/.gitea/workflows/pull-request-ci.yaml index 0261cab..1a5a271 100644 --- a/.gitea/workflows/pull-request-ci.yaml +++ b/.gitea/workflows/pull-request-ci.yaml @@ -5,8 +5,6 @@ on: jobs: lint: name: Lint - env: - RUNNER_TOOL_CACHE: /toolcache runs-on: ubuntu-latest steps: - name: Checkout @@ -28,14 +26,12 @@ jobs: run: go mod tidy - name: Lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v8 with: - version: latest + version: v2.13.2 test: name: Test - env: - RUNNER_TOOL_CACHE: /toolcache runs-on: ubuntu-latest steps: - name: Checkout @@ -66,8 +62,6 @@ jobs: build: name: Build - env: - RUNNER_TOOL_CACHE: /toolcache runs-on: ubuntu-latest steps: - name: Checkout @@ -95,7 +89,7 @@ jobs: - name: Build for linux run: | - fyne build --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION}.${BUILD}-${GOOS}-${GOARCH} + fyne build --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION}-${BUILD}-${GOOS}-${GOARCH} env: VERSION: ${{github.ref_name}} BUILD: ${{github.run_number}} @@ -107,7 +101,7 @@ jobs: - name: Build for windows run: | - fyne build --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION}.${BUILD}-${GOOS}-${GOARCH}.exe + fyne build --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION}-${BUILD}-${GOOS}-${GOARCH}.exe env: VERSION: ${{github.ref_name}} BUILD: ${{github.run_number}} diff --git a/.gitea/workflows/push-ci.yaml b/.gitea/workflows/push-ci.yaml index 03e0505..333c41e 100644 --- a/.gitea/workflows/push-ci.yaml +++ b/.gitea/workflows/push-ci.yaml @@ -6,13 +6,14 @@ on: jobs: lint: name: Lint - env: - RUNNER_TOOL_CACHE: /toolcache runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 + - name: test log + run: env | sort + - name: Setup go uses: actions/setup-go@v5 with: @@ -29,14 +30,12 @@ jobs: run: go mod tidy - name: Lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v8 with: - version: latest + version: v2.13.2 test: name: Test - env: - RUNNER_TOOL_CACHE: /toolcache runs-on: ubuntu-latest steps: - name: Checkout @@ -67,8 +66,6 @@ jobs: build: name: Build - env: - RUNNER_TOOL_CACHE: /toolcache runs-on: ubuntu-latest steps: - name: Checkout @@ -96,7 +93,7 @@ jobs: - name: Build for linux run: | - fyne build --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION}.${BUILD}-${GOOS}-${GOARCH} + fyne build --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION}-${BUILD}-${GOOS}-${GOARCH} ls bin env: VERSION: ${{github.ref_name}} @@ -108,7 +105,7 @@ jobs: - name: Build for windows run: | - fyne build --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION}.${BUILD}-${GOOS}-${GOARCH}.exe + fyne build --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION}-${BUILD}-${GOOS}-${GOARCH}.exe ls bin env: VERSION: ${{github.ref_name}} diff --git a/.gitea/workflows/tag-release.yaml b/.gitea/workflows/tag-release.yaml index f8048b8..2a2816c 100644 --- a/.gitea/workflows/tag-release.yaml +++ b/.gitea/workflows/tag-release.yaml @@ -7,8 +7,6 @@ on: jobs: lint: name: Lint - env: - RUNNER_TOOL_CACHE: /toolcache runs-on: ubuntu-latest steps: - name: Checkout @@ -30,14 +28,13 @@ jobs: run: go mod tidy - name: Lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v8 with: - version: latest + version: v2.13.2 + args: --timeout=5m test: name: Test - env: - RUNNER_TOOL_CACHE: /toolcache runs-on: ubuntu-latest steps: - name: Checkout @@ -68,7 +65,10 @@ jobs: release: name: Build versioned release + needs: [lint, test] runs-on: ubuntu-latest + permissions: + contents: write steps: - name: Checkout uses: actions/checkout@v4 @@ -92,7 +92,7 @@ jobs: - name: Build for linux run: | - fyne build --release --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION#v}.${BUILD}-${GOOS}-${GOARCH} + fyne build --release --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION#v}-${BUILD}-${GOOS}-${GOARCH} env: VERSION: ${{github.ref_name}} BUILD: ${{github.run_number}} @@ -104,7 +104,7 @@ jobs: - name: Build for windows run: | - fyne build --release --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION#v}.${BUILD}-${GOOS}-${GOARCH}.exe + fyne build --release --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION#v}-${BUILD}-${GOOS}-${GOARCH}.exe env: VERSION: ${{github.ref_name}} BUILD: ${{github.run_number}} @@ -120,9 +120,10 @@ jobs: name: swiped-mod-switcher-${{github.ref_name}}-${{github.run_number}} path: bin/ - # - name: Release binaries - # uses: https://gitea.com/actions/release-action@main - # with: - # files: |- - # bin/** - # api_key: '${{secrets.RELEASE_TOKEN}}' + # Prefer built-in job token (Eva): gitea-release-action@v1 defaults to + # github.token / GITEA_TOKEN — no RELEASE_TOKEN / GIT_PACKAGES_TOKEN. + - name: Release binaries + uses: https://gitea.com/actions/gitea-release-action@v1 + with: + files: |- + bin/** diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..cc77230 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,49 @@ +# .golangci.yml — SwipedModSwitcher (golangci-lint v2) +# Adapted from steamcache2 v2 skeleton; no project-specific path excludes yet. +# Run with: golangci-lint run ./... +version: "2" + +run: + timeout: 5m + modules-download-mode: readonly + +linters: + # Defaults (errcheck, govet, ineffassign, staticcheck, unused, …) plus: + enable: + - misspell + settings: + errcheck: + check-type-assertions: false + check-blank: false + staticcheck: + checks: + - all + - "-ST*" + - "-QF*" + govet: + enable-all: true + disable: + - fieldalignment + - shadow + exclusions: + generated: lax + paths: + - dist + - bin + rules: + - path: _test\.go + linters: + - errcheck + +formatters: + enable: + - goimports + exclusions: + generated: lax + paths: + - dist + - bin + +issues: + max-issues-per-linter: 0 + max-same-issues: 0 diff --git a/README.md b/README.md index 11e3938..f05d8fa 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # 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. diff --git a/go.mod b/go.mod index b2c4376..e6cf63a 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module s1d3sw1ped/swipedmodswitcher -go 1.22 +go 1.27.0 require ( fyne.io/fyne/v2 v2.3.5