chore: update ci to publish deb packages #6
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 | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
release: | |
name: Release | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
go: | |
- '1.21' | |
include: | |
- go: '1.21' | |
GO_SEMVER: '~1.21.0' | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.GO_SEMVER }} | |
check-latest: true | |
- name: Install Cloudsmith CLI | |
run: pip install --upgrade cloudsmith-cli | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v4 | |
with: | |
version: latest | |
args: release --clean --timeout 30m | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_PAT }} | |
TAG: ${{ steps.vars.outputs.version_tag }} | |
- name: Publish .deb to Cloudsmith | |
if: ${{ steps.vars.output.tag_special == '' }} | |
env: | |
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} | |
run: | | |
for filename in dist/*.deb; do | |
echo "Pushing $filename to 'stable'" | |
cloudsmith push deb pzip/stable/any-distro/any-version $filename | |
done | |