diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ff4864a..1a1fde9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,6 +15,7 @@ jobs: uses: actions/setup-go@v5 with: go-version: 'stable' + cache: false - name: Run setup run: bash setup.sh @@ -23,7 +24,7 @@ jobs: run: bash tests/run_tests.sh - name: Run build - run: bash build.sh + run: bash build.sh ${{ github.ref_name }} ${{ github.sha }} - name: Release uses: softprops/action-gh-release@v2 diff --git a/.github/workflows/tests_go.yml b/.github/workflows/tests_go.yml index c5d61b0..a66f08f 100644 --- a/.github/workflows/tests_go.yml +++ b/.github/workflows/tests_go.yml @@ -20,6 +20,7 @@ jobs: uses: actions/setup-go@v5 with: go-version: 'stable' + cache: false - name: Display Go version run: go version diff --git a/build.sh b/build.sh index 6912e11..7b2b20b 100644 --- a/build.sh +++ b/build.sh @@ -2,12 +2,10 @@ SCRIPTDIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) BUILDDIR=$SCRIPTDIR/build -GIT_REV=`git rev-parse --abbrev-ref HEAD` -COMMIT_HASH="$(git rev-parse --short HEAD)" BUILD_TIMESTAMP=$(date -u '+%Y-%m-%dT%H:%M:%S%z') LDFLAGS=( - "-X 'main.version=${GIT_REV}'" - "-X 'main.commitHash=${COMMIT_HASH}'" + "-X 'main.version=$1'" + "-X 'main.commitHash=$2'" "-X 'main.buildTime=${BUILD_TIMESTAMP}'" )