Skip to content

Implement MDS048 git-hook-sync rule and pre-merge-commit hook automat… #5

Implement MDS048 git-hook-sync rule and pre-merge-commit hook automat…

Implement MDS048 git-hook-sync rule and pre-merge-commit hook automat… #5

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
permissions:
contents: read
jobs:
build:
strategy:
matrix:
include:
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
- goos: windows
goarch: amd64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version-file: go.mod
cache: false
- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
VERSION: ${{ github.ref_name }}
run: |
ext=""
if [ "$GOOS" = "windows" ]; then ext=".exe"; fi
bin="mdsmith-${GOOS}-${GOARCH}${ext}"
go build -trimpath -ldflags="-s -w -X main.version=${VERSION}" -o "$bin" ./cmd/mdsmith
echo "bin=$bin" >> "$GITHUB_ENV"
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: mdsmith-${{ matrix.goos }}-${{ matrix.goarch }}
path: ${{ env.bin }}
release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
merge-multiple: true
- name: Create checksums
run: sha256sum mdsmith-* > checksums.txt
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2.3.2
with:
generate_release_notes: true
files: |
mdsmith-*
checksums.txt