add cli test coverage #4
Workflow file for this run
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
name: Release Go Binaries | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
go-releaser: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # for go-releaser binaries (add and cleanup) | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# Use go-releaser to build binaries outside docker | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
- name: Run GoReleaser to build and release binaries (only once on linux/amd64) | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
distribution: goreleaser | |
version: latest | |
#args: build --clean # use this if you only need binaries w/o releasing anything | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
#- name: Move goreleaser generated binaries to a predictable platform path for docker build | |
# use target subdirectory app/${{ matrix.platform }}/, which is passed as build arg to docker build, | |
# copy platform specific binary in actual image (the other one was built in vain, but it's fast :-)) | |
# see also https://goreleaser.com/customization/builds/#why-is-there-a-_v1-suffix-on-amd64-builds | |
# run: | | |
# mkdir -p app/linux/amd64 | |
# mkdir -p app/linux/arm64 | |
# mv -v dist/${{ github.event.repository.name }}_linux_amd64_v1/${{ github.event.repository.name }} \ | |
# app/linux/amd64/${{ github.event.repository.name }} | |
# mv -v dist/${{ github.event.repository.name }}_linux_arm64/${{ github.event.repository.name }} \ | |
# app/linux/arm64/${{ github.event.repository.name }} | |
# mv -v dist/polly_linux_amd64_v1/polly app/linux/amd64/polly | |
# mv -v dist/polly_linux_arm64/polly app/linux/arm64/polly | |
# - name: Upload binaries built by go-releaser | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: go-releaser-binaries | |
# path: dist/ | |
# if-no-files-found: error | |
# retention-days: 1 | |
# https://github.com/marketplace/actions/delete-older-releases | |
- name: Delete old released binaries | |
uses: dev-drprasad/[email protected] | |
with: | |
#repo: <owner>/<repoName> # defaults to current repo | |
keep_latest: 5 | |
keep_min_download_counts: 1 # Optional parameters | |
delete_expired_data: 30 # must set, or nothing gets removed | |
#delete_tag_pattern: beta # defaults to "" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |