mirror of
1
Fork 0

chore(ci): do not hardcode go version, use go.mod instead

This commit is contained in:
Earl Warren 2024-08-03 09:55:09 +02:00
parent 37151d75cb
commit 94f3589623
No known key found for this signature in database
GPG Key ID: 0579CB2928A78A00
6 changed files with 14 additions and 18 deletions

View File

@ -0,0 +1,3 @@
module code.gitea.io/gitea
go 1.22.5

View File

@ -43,8 +43,7 @@ jobs:
- uses: https://code.forgejo.org/actions/setup-go@v4 - uses: https://code.forgejo.org/actions/setup-go@v4
with: with:
go-version: "1.22" go-version-file: "go.mod"
check-latest: true
- name: version from ref - name: version from ref
id: release-info id: release-info

View File

@ -19,8 +19,7 @@ jobs:
- uses: https://code.forgejo.org/actions/checkout@v4 - uses: https://code.forgejo.org/actions/checkout@v4
- uses: https://code.forgejo.org/actions/setup-go@v4 - uses: https://code.forgejo.org/actions/setup-go@v4
with: with:
go-version: "1.22" go-version-file: "go.mod"
check-latest: true
- run: | - run: |
apt-get -qq update apt-get -qq update
apt-get -qq install -q sudo apt-get -qq install -q sudo

View File

@ -74,8 +74,7 @@ jobs:
if: vars.ROLE == 'forgejo-experimental' && secrets.OVH_APP_KEY != '' if: vars.ROLE == 'forgejo-experimental' && secrets.OVH_APP_KEY != ''
uses: https://code.forgejo.org/actions/setup-go@v4 uses: https://code.forgejo.org/actions/setup-go@v4
with: with:
go-version: "1.22" go-version-file: "go.mod"
check-latest: true
- name: update the _release.experimental DNS record - name: update the _release.experimental DNS record
if: vars.ROLE == 'forgejo-experimental' && secrets.OVH_APP_KEY != '' if: vars.ROLE == 'forgejo-experimental' && secrets.OVH_APP_KEY != ''
uses: https://code.forgejo.org/actions/ovh-dns-update@v1 uses: https://code.forgejo.org/actions/ovh-dns-update@v1

View File

@ -22,8 +22,7 @@ jobs:
- uses: https://code.forgejo.org/actions/checkout@v3 - uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4 - uses: https://code.forgejo.org/actions/setup-go@v4
with: with:
go-version: "1.22" go-version-file: "go.mod"
check-latest: true
- run: make deps-backend deps-tools - run: make deps-backend deps-tools
- run: make --always-make -j$(nproc) lint-backend tidy-check swagger-check fmt-check swagger-validate # ensure the "go-licenses" make target runs - run: make --always-make -j$(nproc) lint-backend tidy-check swagger-check fmt-check swagger-validate # ensure the "go-licenses" make target runs
frontend-checks: frontend-checks:
@ -62,7 +61,7 @@ jobs:
- uses: https://code.forgejo.org/actions/checkout@v3 - uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4 - uses: https://code.forgejo.org/actions/setup-go@v4
with: with:
go-version: "1.22" go-version-file: "go.mod"
- run: | - run: |
git config --add safe.directory '*' git config --add safe.directory '*'
adduser --quiet --comment forgejo --disabled-password forgejo adduser --quiet --comment forgejo --disabled-password forgejo
@ -121,7 +120,7 @@ jobs:
- uses: https://code.forgejo.org/actions/checkout@v3 - uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4 - uses: https://code.forgejo.org/actions/setup-go@v4
with: with:
go-version: "1.22" go-version-file: "go.mod"
- run: | - run: |
git config --add safe.directory '*' git config --add safe.directory '*'
adduser --quiet --comment forgejo --disabled-password forgejo adduser --quiet --comment forgejo --disabled-password forgejo
@ -167,7 +166,7 @@ jobs:
- uses: https://code.forgejo.org/actions/checkout@v3 - uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4 - uses: https://code.forgejo.org/actions/setup-go@v4
with: with:
go-version: "1.22" go-version-file: "go.mod"
- name: install dependencies & git >= 2.42 - name: install dependencies & git >= 2.42
run: | run: |
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
@ -216,7 +215,7 @@ jobs:
- uses: https://code.forgejo.org/actions/checkout@v3 - uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4 - uses: https://code.forgejo.org/actions/setup-go@v4
with: with:
go-version: "1.22" go-version-file: "go.mod"
- name: install dependencies & git >= 2.42 - name: install dependencies & git >= 2.42
run: | run: |
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
@ -254,7 +253,7 @@ jobs:
- uses: https://code.forgejo.org/actions/checkout@v3 - uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4 - uses: https://code.forgejo.org/actions/setup-go@v4
with: with:
go-version: "1.22" go-version-file: "go.mod"
- name: install dependencies & git >= 2.42 - name: install dependencies & git >= 2.42
run: | run: |
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
@ -297,7 +296,6 @@ jobs:
- uses: https://code.forgejo.org/actions/checkout@v3 - uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4 - uses: https://code.forgejo.org/actions/setup-go@v4
with: with:
go-version: "1.22" go-version-file: "go.mod"
check-latest: true
- run: make deps-backend deps-tools - run: make deps-backend deps-tools
- run: make security-check - run: make security-check

4
go.mod
View File

@ -1,8 +1,6 @@
module code.gitea.io/gitea module code.gitea.io/gitea
go 1.22.0 go 1.22.5
toolchain go1.22.5
require ( require (
code.forgejo.org/f3/gof3/v3 v3.4.0 code.forgejo.org/f3/gof3/v3 v3.4.0