Skip to content

Pass tag/branch and commit sha to go-releaser via environment variabl… #4

Pass tag/branch and commit sha to go-releaser via environment variabl…

Pass tag/branch and commit sha to go-releaser via environment variabl… #4

Workflow file for this run

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 }}