Added Git short hash (commit hash) to archive filenames #7
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: Kanvas Snapshot Build & Release | |
on: | |
release: | |
types: [published] | |
pull_request: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
release: | |
if: | | |
(github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v') && | |
!contains(github.ref, 'patch') && !contains(github.ref, 'alpha') && | |
!contains(github.ref, 'beta') && !contains(github.ref, 'rc')) || | |
(github.event_name == 'pull_request') | |
runs-on: macos-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.21" | |
- name: Get Git short hash | |
run: echo "GIT_HASH=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_ENV | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: v1.59 | |
working-directory: ./cmd/kanvas-snapshot | |
args: --timeout 10m --verbose | |
skip-cache: true | |
- name: Run GoReleaser with tag | |
uses: goreleaser/goreleaser-action@v6 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
RELEASE_CHANNEL: "stable" | |
PROVIDER_TOKEN: ${{ secrets.PROVIDER_TOKEN }} | |
with: | |
version: 2 | |
args: release --clean --skip validate -f .github/.goreleaser.yml |