From 27ceca252be2de5a2a48bc9cfec2f2e10eceb2fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=9E=E3=83=AA=E3=82=A6=E3=82=B9?= Date: Sat, 17 Oct 2020 14:02:48 +0100 Subject: [PATCH] Updated release.yaml workflow --- .github/workflows/release.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8103ef2..f86326a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -9,6 +9,10 @@ jobs: runs-on: ubuntu-latest steps: + - name: Get version + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + - uses: actions/checkout@v2 - name: Setup Go @@ -27,7 +31,7 @@ jobs: golint . - name: Run build - run: go build -v . + run: go build -v -ldflags "-X github.com/mrusme/zeit/z.VERSION=${{ steps.get_version.outputs.VERSION }}" . # - name: Run testing # run: cd test && go test -v @@ -39,6 +43,10 @@ jobs: if: github.event_name == 'push' steps: + - name: Get version + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + - name: Check out repository uses: actions/checkout@v2 @@ -70,7 +78,7 @@ jobs: echo "" echo "=== Building ${GOOS} ${GOARCH} ===" - go build -v . + go build -v -ldflags "-X github.com/mrusme/zeit/z.VERSION=${{ steps.get_version.outputs.VERSION }}" . tar -czf ./zeit_${GOOS}_${GOARCH}.tar.gz zeit go clean