2
2
mirror of https://github.com/octoleo/restic.git synced 2024-06-05 02:20:50 +00:00

Use "go get" or "go install" selectively

Go 1.18 dropped support for installing binaries via "go get", Go <= 1.16
does not support it. So we need to use the right verb depending on the
Go version.
This commit is contained in:
Alexander Neumann 2022-03-20 11:00:48 +01:00
parent 9b57fcc6b0
commit 18a1de0de1

View File

@ -17,11 +17,13 @@ jobs:
- job_name: Windows - job_name: Windows
go: 1.18.x go: 1.18.x
os: windows-latest os: windows-latest
install_verb: install
- job_name: macOS - job_name: macOS
go: 1.18.x go: 1.18.x
os: macOS-latest os: macOS-latest
test_fuse: false test_fuse: false
install_verb: install
- job_name: Linux - job_name: Linux
go: 1.18.x go: 1.18.x
@ -29,26 +31,31 @@ jobs:
test_cloud_backends: true test_cloud_backends: true
test_fuse: true test_fuse: true
check_changelog: true check_changelog: true
install_verb: install
- job_name: Linux - job_name: Linux
go: 1.17.x go: 1.17.x
os: ubuntu-latest os: ubuntu-latest
test_fuse: true test_fuse: true
install_verb: install
- job_name: Linux - job_name: Linux
go: 1.16.x go: 1.16.x
os: ubuntu-latest os: ubuntu-latest
test_fuse: true test_fuse: true
install_verb: get
- job_name: Linux - job_name: Linux
go: 1.15.x go: 1.15.x
os: ubuntu-latest os: ubuntu-latest
test_fuse: true test_fuse: true
install_verb: get
- job_name: Linux - job_name: Linux
go: 1.14.x go: 1.14.x
os: ubuntu-latest os: ubuntu-latest
test_fuse: true test_fuse: true
install_verb: get
name: ${{ matrix.job_name }} Go ${{ matrix.go }} name: ${{ matrix.job_name }} Go ${{ matrix.go }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@ -65,7 +72,7 @@ jobs:
- name: Get programs (Linux/macOS) - name: Get programs (Linux/macOS)
run: | run: |
echo "build Go tools" echo "build Go tools"
go get github.com/restic/rest-server/... go ${{ matrix.install_verb }} github.com/restic/rest-server/cmd/rest-server@latest
echo "install minio server" echo "install minio server"
mkdir $HOME/bin mkdir $HOME/bin
@ -97,7 +104,7 @@ jobs:
$ProgressPreference = 'SilentlyContinue' $ProgressPreference = 'SilentlyContinue'
echo "build Go tools" echo "build Go tools"
go get github.com/restic/rest-server/... go ${{ matrix.install_verb }} github.com/restic/rest-server/...
echo "install minio server" echo "install minio server"
mkdir $Env:USERPROFILE/bin mkdir $Env:USERPROFILE/bin
@ -187,7 +194,7 @@ jobs:
- name: Check changelog files with calens - name: Check changelog files with calens
run: | run: |
echo "install calens" echo "install calens"
go get github.com/restic/calens go ${{ matrix.install_verb }} github.com/restic/calens
echo "check changelog files" echo "check changelog files"
calens calens
@ -229,7 +236,7 @@ jobs:
- name: Install gox - name: Install gox
run: | run: |
go get github.com/mitchellh/gox go install github.com/mitchellh/gox
- name: Cross-compile with gox for ${{ matrix.targets }} - name: Cross-compile with gox for ${{ matrix.targets }}
env: env: