Skip to content

Build and Release

Build and Release #9

name: Build and Release
on:
workflow_dispatch:
inputs:
repository:
description: 'The repository from which the slash command was dispatched'
required: true
comment-id:
description: 'The comment-id of the slash command'
required: true
tag:
description: 'The tag to be released'
required: true
jobs:
release:
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, windows, darwin, freebsd]
goarch: ["386", amd64, arm64]
exclude:
- goarch: "386"
goos: darwin
- goarch: arm64
goos: windows
steps:
- uses: actions/checkout@v4
- uses: wangyoucao577/go-release-action@v1.42
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: "https://dl.google.com/go/go1.20.1.linux-amd64.tar.gz"
project_path: "./cmd/HellPot"
binary_name: "HellPot"
extra_files: LICENSE README.md
build_flags: -trimpath
pre_command: export CGO_ENABLED=0
ldflags: -s -w -X main.version=${{ github.event.inputs.tag }}
release_tag: ${{ github.event.inputs.tag }}
- name: Add reaction
uses: peter-evans/create-or-update-comment@v3
with:
token: ${{ secrets.PAT }}
repository: ${{ github.event.inputs.repository }}
comment-id: ${{ github.event.inputs.comment-id }}
reaction-type: hooray