avoid copying the response when getting the timeline #29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 CI/CD | |
env: | |
AUTH_TOKEN: ${{secrets.AUTH_TOKEN}} | |
CT0: ${{secrets.CT0}} | |
permissions: | |
contents: write | |
on: | |
push: | |
branches: [ "master" ] | |
tags: | |
- "v*" | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
- name: Build for Win | |
if: ${{'windows-latest' == matrix.os}} | |
run: | | |
$env:GOARCH = "amd64" | |
$env:CGO_ENABLED = "1" | |
go build -o bin/tmd2-${{ runner.os }}-amd64.exe -v -ldflags "-w -s". | |
- name: Build for Unix | |
if: ${{'windows-latest' != matrix.os}} | |
run: | | |
GOARCH=amd64 CGO_ENABLED=1 go build -o bin/tmd2-${{ runner.os }}-amd64 -v -ldflags "-w -s". | |
- name: Test | |
if: ${{!startsWith(github.ref, 'refs/tags/v')}} | |
run: go test ./... | |
- name: Update coverage badge | |
if: ${{'ubuntu-latest' == matrix.os && !startsWith(github.ref, 'refs/tags/v')}} | |
uses: ncruces/go-coverage-report@main | |
with: | |
amend: true | |
- name: Release | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: ./bin/* |