Skip to content

Commit

Permalink
Adopted mise
Browse files Browse the repository at this point in the history
  • Loading branch information
inverse committed Jan 11, 2024
1 parent 72da380 commit b0bd1a7
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 22 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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/[email protected]
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:
Expand Down
30 changes: 21 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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/[email protected]
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/[email protected]
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 }}
Expand Down
6 changes: 6 additions & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
@@ -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"
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 0 additions & 5 deletions .tool-versions

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b0bd1a7

Please sign in to comment.