Skip to content

.github/workflows/release.yml: set correct title #5

.github/workflows/release.yml: set correct title

.github/workflows/release.yml: set correct title #5

Workflow file for this run

name: Create release
on:
push:
tags:
- v*
permissions:
contents: write
jobs:
release:
name: Release pushed tag
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Compile go binary
env:
CGO_ENABLED: 0
GOOS: linux
GOARCH: amd64
run: |
mkdir -p dist
go build \
-ldflags="-s -w -extldflags '-static'" \
-o dist/
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="$tag" \
--generate-notes \
-d
- name: Upload assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
gh release upload "$tag" dist/* --repo="$GITHUB_REPOSITORY"