From a513d9987b4f884d16495ba300cdbe22ff20df4e Mon Sep 17 00:00:00 2001 From: rjuer <21335146+rjuer@users.noreply.github.com> Date: Sat, 14 Sep 2024 06:15:46 +0200 Subject: [PATCH] Fetch fetch full history and tags in all CI workflows --- .github/workflows/release.yml | 10 ++++++++-- .github/workflows/test.yml | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b92c0ef..96884fc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,10 @@ jobs: goos: ["linux", "darwin"] goarch: ["amd64", "arm64"] steps: - - uses: actions/checkout@v4 + - name: Check out code + uses: actions/checkout@v4 + with: + fetch-depth: 0 # ensure all history and tags are fetched - name: Install Go toolchain uses: actions/setup-go@v5 with: @@ -39,7 +42,10 @@ jobs: goos: ["linux", "darwin"] goarch: ["amd64", "arm64"] steps: - - uses: actions/checkout@v4 + - name: Check out code + uses: actions/checkout@v4 + with: + fetch-depth: 0 # ensure all history and tags are fetched - name: Install Go toolchain uses: actions/setup-go@v5 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 804ccd5..879acea 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,7 @@ jobs: - name: Build run: | mkdir dist - env GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -ldflags="-s -w -X 'github.com/rjuer/cidr/cmd.version=$VERSION'" -o dist/ + env GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -ldflags="-s -w -X 'github.com/rjuer/cidr/cmd.version=$(VERSION)'" -o dist/ - name: Test run: | mkdir tmp