Skip to content

Commit

Permalink
actionsでGoのバージョンをgo.modから読み取る
Browse files Browse the repository at this point in the history
  • Loading branch information
ikura-hamu committed Aug 9, 2023
1 parent 2267152 commit db18d27
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Read Go version
run: echo "GO_VERSION=$(cat ./.go-version)" >> $GITHUB_ENV
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: "./go.mod"
- run: go mod download
- run: make traQ
- uses: actions/upload-artifact@v3
Expand All @@ -28,11 +26,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Read Go version
run: echo "GO_VERSION=$(cat ./.go-version)" >> $GITHUB_ENV
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: "./go.mod"
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand All @@ -52,11 +48,9 @@ jobs:
- 3306:3306
steps:
- uses: actions/checkout@v3
- name: Read Go version
run: echo "GO_VERSION=$(cat ./.go-version)" >> $GITHUB_ENV
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: "./go.mod"
- name: Run tests
run: |
export TRAQ_IMAGEMAGICK=`which convert`
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,9 @@ jobs:
with:
# goreleaserがchangelogを生成する用
fetch-depth: 0
- name: Read Go version
run: echo "GO_VERSION=$(cat ./.go-version)" >> $GITHUB_ENV
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: "./go.mod"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
Expand Down
1 change: 0 additions & 1 deletion .go-version

This file was deleted.

0 comments on commit db18d27

Please sign in to comment.