Skip to content

readme

readme #19

Workflow file for this run

name: Create Release
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
build:
name: Create release
runs-on: ubuntu-latest
env:
GO111MODULE: "auto"
strategy:
matrix:
include:
- os: linux
arch: amd64
- os: darwin
arch: amd64
- os: windows
arch: amd64
steps:
- name: Install GO
uses: actions/setup-go@v3
with:
go-version: 1.21
- name: Checkout repository
uses: actions/checkout@v3
- name: Get version tag
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- name: Build
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
id: build
run: |
go build -o githunt -ldflags "-X main.version=${{ steps.get_version.outputs.VERSION }}"
zip -m githunt-${{ matrix.os }}-${{ matrix.arch }}.zip githunt
echo ::set-output name=FILENAME::githunt-${{ matrix.os }}-${{ matrix.arch }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUBTOKEN }}
file: ${{ steps.build.outputs.FILENAME }}.zip
asset_name: ${{ steps.build.outputs.FILENAME }}.zip
tag: ${{ github.ref }}
overwrite: true
body: "githunt ${{ steps.get_version.outputs.VERSION }} ${{ steps.build.outputs.FILENAME }}"