diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 6e99152..17635ff 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,7 +1,7 @@ name: Generate coverage badges on: push: - branches: [main] + branches: [v2] permissions: contents: write @@ -10,7 +10,7 @@ jobs: generate-badges: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 # setup go environment - name: Set up Go @@ -21,13 +21,14 @@ jobs: - name: coverage id: coverage run: | - go test -coverpkg=./... -coverprofile=profile.cov ./... - # sed -i '/cmd/d' profile.cov # remove cmd package from coverage + go mod download + go generate ./... + go test -coverpkg=./... -coverprofile=profile.cov $(go list ./... | grep -v /cmd/) total=$(go tool cover -func profile.cov | grep '^total:' | awk '{print $3}' | sed "s/%//") rm profile.cov echo "COVERAGE_VALUE=${total}" >> $GITHUB_ENV - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: repository: sgaunet/gh-action-badge path: gh-action-badge diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 8228111..166a24d 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -1,33 +1,34 @@ name: linter on: - pull_request: push: permissions: - contents: write + contents: read jobs: linter: runs-on: ubuntu-latest steps: - - - name: Checkout - uses: actions/checkout@v4 + - uses: actions/checkout@v5 + - uses: actions/setup-go@v5 with: - fetch-depth: 0 - - name: Install Go - uses: actions/setup-go@v5 + go-version: stable + - name: Install task + uses: jaxxstorm/action-install-gh-release@v1.12.0 with: - go-version: '>=1.24' - - name: Install devbox - uses: jetify-com/devbox-install-action@v0.12.0 + repo: go-task/task + cache: enable + # tag: + - name: Install golangci-lint + uses: jaxxstorm/action-install-gh-release@v1.12.0 with: - enable-cache: true - devbox-version: 0.14.0 + repo: golangci/golangci-lint + tag: v2.2.2 + cache: enable + binaries-location: golangci-lint-2.2.2-linux-amd64 - - name: Install prerequisites + - name: Run linter shell: /usr/bin/bash {0} run: | - devbox install - devbox run linter + task linter \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5716c1f..b7ed3ed 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,18 +16,23 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 - name: Install Go uses: actions/setup-go@v5 with: go-version: '>=1.24' - - name: Install devbox - uses: jetify-com/devbox-install-action@v0.12.0 + - name: Install task + uses: jaxxstorm/action-install-gh-release@v1.12.0 with: - enable-cache: true - devbox-version: 0.14.0 + repo: go-task/task + # tag: + - name: Install goreleaser + uses: jaxxstorm/action-install-gh-release@v1.12.0 + with: + repo: goreleaser/goreleaser + # tag: - # Add support for more platforms with QEMU (optional) @@ -45,11 +50,10 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Install prerequisites + - name: Create release shell: /usr/bin/bash {0} run: | - devbox install - devbox run release + task release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 2d8d678..b15fc95 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -1,11 +1,10 @@ name: snapshot on: - pull_request: push: permissions: - contents: write + contents: read jobs: goreleaser-snapshot: @@ -13,19 +12,26 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 - name: Install Go uses: actions/setup-go@v5 with: go-version: '>=1.24' - - name: Install devbox - uses: jetify-com/devbox-install-action@v0.12.0 + - name: Install task + uses: jaxxstorm/action-install-gh-release@v1.12.0 with: - enable-cache: true - devbox-version: 0.14.0 - + repo: go-task/task + cache: true + # tag: + - name: Install goreleaser + uses: jaxxstorm/action-install-gh-release@v1.12.0 + with: + repo: goreleaser/goreleaser + cache: true + # tag: + - # Add support for more platforms with QEMU (optional) # https://github.com/docker/setup-qemu-action @@ -42,11 +48,10 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Install prerequisites + - name: Create snapshot release shell: /usr/bin/bash {0} run: | - devbox install - devbox run snapshot + task snapshot env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution diff --git a/.gitignore b/.gitignore index 56159a4..176e209 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -dist -gitlab-backup2s3 -.task -tst \ No newline at end of file +/dist +/gitlab-backup2s3 +/.task \ No newline at end of file diff --git a/.golangci.yml b/.golangci.yml index eafd2db..16fcdf3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -9,6 +9,7 @@ linters: disable: - wsl + - wsl_v5 - nlreturn - depguard - gochecknoinits diff --git a/Taskfile.yml b/Taskfile.yml index 2ca9126..2deac6f 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -39,4 +39,4 @@ tasks: release: desc: "Create a release" cmds: - - GITLAB_TOKEN="" goreleaser --clean --skip validate + - GITLAB_TOKEN="" goreleaser --clean diff --git a/devbox.json b/devbox.json deleted file mode 100644 index bd47e13..0000000 --- a/devbox.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.13.4/.schema/devbox.schema.json", - "packages": [ - "goreleaser@2.9.0", - "go-task@3.41.0", - "golangci-lint@2.1.6" - ], - "shell": { - "init_hook": [ - "echo 'Welcome to devbox!' > /dev/null" - ], - "scripts": { - "build": [ - "task build" - ], - "run": [ - "task run" - ], - "linter": [ - "task linter" - ], - "snapshot": [ - "task snapshot" - ], - "release": [ - "task release" - ] - } - } -} diff --git a/devbox.lock b/devbox.lock deleted file mode 100644 index b72e34c..0000000 --- a/devbox.lock +++ /dev/null @@ -1,129 +0,0 @@ -{ - "lockfile_version": "1", - "packages": { - "go-task@3.41.0": { - "last_modified": "2025-04-17T05:47:26Z", - "resolved": "github:NixOS/nixpkgs/ebe4301cbd8f81c4f8d3244b3632338bbeb6d49c#go-task", - "source": "devbox-search", - "version": "3.41.0", - "systems": { - "aarch64-darwin": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/zz0ydwqf8s4dmdrhrd2i8h467mxsdgib-go-task-3.41.0", - "default": true - } - ], - "store_path": "/nix/store/zz0ydwqf8s4dmdrhrd2i8h467mxsdgib-go-task-3.41.0" - }, - "aarch64-linux": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/gw5m0vszm1arqri0f23x2myhn48njy8a-go-task-3.41.0", - "default": true - } - ], - "store_path": "/nix/store/gw5m0vszm1arqri0f23x2myhn48njy8a-go-task-3.41.0" - }, - "x86_64-darwin": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/hyp3mswald858k3kpbyc63h4dz2xfl18-go-task-3.41.0", - "default": true - } - ], - "store_path": "/nix/store/hyp3mswald858k3kpbyc63h4dz2xfl18-go-task-3.41.0" - }, - "x86_64-linux": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/h39sp829c75dccfp5jk8a5aqap4gpn8m-go-task-3.41.0", - "default": true - } - ], - "store_path": "/nix/store/h39sp829c75dccfp5jk8a5aqap4gpn8m-go-task-3.41.0" - } - } - }, - "golangci-lint@2.1.6": { - "last_modified": "2025-05-06T08:06:31Z", - "resolved": "github:NixOS/nixpkgs/1cb1c02a6b1b7cf67e3d7731cbbf327a53da9679#golangci-lint", - "source": "devbox-search", - "version": "2.1.6", - "systems": { - "aarch64-linux": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/nzfzphypaibr5md38sqjm91i8azhynj4-golangci-lint-2.1.6", - "default": true - } - ], - "store_path": "/nix/store/nzfzphypaibr5md38sqjm91i8azhynj4-golangci-lint-2.1.6" - }, - "x86_64-linux": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/05p9lrvs0d7qqcd2vdks2lvmvi0kdp05-golangci-lint-2.1.6", - "default": true - } - ], - "store_path": "/nix/store/05p9lrvs0d7qqcd2vdks2lvmvi0kdp05-golangci-lint-2.1.6" - } - } - }, - "goreleaser@2.9.0": { - "last_modified": "2025-04-30T16:14:55Z", - "resolved": "github:NixOS/nixpkgs/70b191e2e0b1b5fe8586ad939dfa01f3047865f7#goreleaser", - "source": "devbox-search", - "version": "2.9.0", - "systems": { - "aarch64-darwin": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/80r1z38i8184lp7xxcs6ss9khszh4gyf-goreleaser-2.9.0", - "default": true - } - ], - "store_path": "/nix/store/80r1z38i8184lp7xxcs6ss9khszh4gyf-goreleaser-2.9.0" - }, - "aarch64-linux": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/pg2by80fn5i3dgxkl0ad4m56njvpjnax-goreleaser-2.9.0", - "default": true - } - ], - "store_path": "/nix/store/pg2by80fn5i3dgxkl0ad4m56njvpjnax-goreleaser-2.9.0" - }, - "x86_64-darwin": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/r879776j6ymhyd3fg1jlqsy4v5aca5nd-goreleaser-2.9.0", - "default": true - } - ], - "store_path": "/nix/store/r879776j6ymhyd3fg1jlqsy4v5aca5nd-goreleaser-2.9.0" - }, - "x86_64-linux": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/iibmw8lki8rf2kanzpg6c6n9llfq1737-goreleaser-2.9.0", - "default": true - } - ], - "store_path": "/nix/store/iibmw8lki8rf2kanzpg6c6n9llfq1737-goreleaser-2.9.0" - } - } - } - } -}