diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6bdd820..dc11695 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,17 +9,25 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Get Go version from .tool-versions - run: echo "GO_VERSION=$(cat .tool-versions | grep -oP 'golang \K((\w+.)+\w+)')" >> $GITHUB_ENV - - name: Get golangci-lint version from .tool-versions - run: echo "GOLANGCI_LINT_VERSION=$(cat .tool-versions | grep -oP 'golangci-lint \K((\w+.)+\w+)')" >> $GITHUB_ENV + - name: Get Go version from .mise.toml + uses: SebRollen/toml-action@v1.0.2 + id: get-golang-version + with: + file: .mise.toml + field: tools.golang - uses: actions/setup-go@v5 with: - go-version: '${{ env.GO_VERSION }}' + go-version: '${{ steps.get-golang-version.outputs.value }}' + - name: Get golangci-lint version from .mise.toml + uses: SebRollen/toml-action@v1.0.2 + id: get-golangci-lint-version + with: + file: .mise.toml + field: tools.golangci-lint - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: 'v${{ env.GOLANGCI_LINT_VERSION }}' + version: 'v'${{ steps.get-golangci-lint-version.outputs.value }}' pre-commit: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b666ce3..5219b05 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,31 +16,43 @@ jobs: with: fetch-depth: 0 - run: git fetch --force --tags - - name: Get Go version from .tool-versions - run: echo "GO_VERSION=$(cat .tool-versions | grep -oP 'golang \K((\w+.)+\w+)')" >> $GITHUB_ENV + - name: Get Golang version from .mise.toml + uses: SebRollen/toml-action@v1.0.2 + id: get-golang-version + with: + file: .mise.toml + field: tools.golang - uses: actions/setup-go@v5 with: - go-version: '${{ env.GO_VERSION }}' - - name: Get nfpm version from .tool-versions - run: echo "NFPM_VERSION=$(cat .tool-versions | grep -oP 'nfpm \K((\w+.)+\w+)')" >> $GITHUB_ENV + go-version: '${{ steps.get-golang-version.outputs.value }}' + - name: Get nfpm version from .mise.toml + uses: SebRollen/toml-action@v1.0.2 + id: get-golang-version + with: + file: .mise.toml + field: tools.nfpm - name: Setup nfpm uses: supplypike/setup-bin@v3 with: uri: 'https://github.com/goreleaser/nfpm/releases/download/v${{ env.NFPM_VERSION }}/nfpm_${{ env.NFPM_VERSION }}_Linux_x86_64.tar.gz' name: 'nfpm' - version: '${{ env.NFPM_VERSION }}' + version: '${{ steps.get-nfpm-version.outputs.value }}' - name: Setup fury uses: supplypike/setup-bin@v3 with: uri: 'https://github.com/gemfury/cli/releases/download/v0.20.1/fury_0.20.1_Linux_64bit.tar.gz' name: 'fury' version: '0.20.1' - - name: Get goreleaser version from .tool-versions - run: echo "GORELEASER_VERSION=$(cat .tool-versions | grep -oP 'goreleaser \K((\w+.)+\w+)')" >> $GITHUB_ENV + - name: Get goreleaser version from .mise.toml + uses: SebRollen/toml-action@v1.0.2 + id: get-goreleaser-version + with: + file: .mise.toml + field: tools.goreleaser - uses: goreleaser/goreleaser-action@v5 with: distribution: goreleaser - version: '${{ env.GORELEASER_VERSION }}' + version: '${{ steps.get-goreleaser-version.outputs.value }}' args: release --clean env: GITHUB_TOKEN: ${{ secrets.GH_PAT }} diff --git a/.mise.toml b/.mise.toml new file mode 100644 index 0000000..adf35ea --- /dev/null +++ b/.mise.toml @@ -0,0 +1,6 @@ +[tools] +golang = "1.20.4" +golangci-lint = "1.52.2" +goreleaser = "1.18.2" +nfpm = "2.28.0" +task = "3.24.0" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bd5b3e2..c3ddcdb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,8 +1,9 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - id: check-added-large-files + - id: check-toml diff --git a/.tool-versions b/.tool-versions deleted file mode 100644 index 7613d56..0000000 --- a/.tool-versions +++ /dev/null @@ -1,5 +0,0 @@ -golang 1.20.4 -golangci-lint 1.52.2 -goreleaser 1.18.2 -nfpm 2.28.0 -task 3.24.0 diff --git a/README.md b/README.md index 322f9c3..0bac318 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ _Note: Sessions are scoped to git repositories by leveraging commit templates._ ## Developing -Built using asdf for managing required development dependencies. +Built using [`mise`](https://github.com/jdx/mise) for managing required development dependencies. ### Building