Skip to content

Go

Go #99

Workflow file for this run

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
push:
branches: [ "chore/workflow-create-release-on-tag" ]
pull_request:
branches: [ "chore/workflow-create-release-on-tag" ]
create:
tags:
- 'v*.*.*'
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Check Golang imports order and formatting
uses: Jerome1337/[email protected]
- name: Test
run: CGO_ENABLED=0 go test -v ./...
- name: Build Linux
run: |
export GOOS=linux
export GARCH=amd64
CGO_ENABLED=0 go build -o tm_catalog_cli-${GOOS}_${GARCH}
- name: Release
if: startsWith(github.ref, 'refs/tags')
uses: softprops/action-gh-release@v1
with:
files:
tm_catalog_cli-linux_amd64
token: ${{ secrets.GITHUB_TOKEN }}