Pass tag/branch and commit sha to go-releaser via environment variabl… #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: goreleaser | |
on: | |
push: | |
tags: | |
- '*' | |
permissions: | |
contents: write | |
jobs: | |
goreleaser: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- | |
name: Set up Go | |
uses: actions/setup-go@v2 | |
- | |
name: Set Variables used in .goreleaser.yml for ldflags | |
run: | | |
echo "VAULTPAL_VERSION=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_ENV | |
echo "VAULTPAL_COMMIT=$(echo ${GITHUB_REF#refs/heads/})" >> "$GITHUB_ENV" | |
- | |
name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v4 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --rm-dist | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |