publish releases to Cloudsmith #12
Workflow file for this run
This file contains hidden or 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*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.26" | |
| - name: Test | |
| run: go test -race ./... | |
| release: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.26" | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@v7 | |
| with: | |
| version: latest | |
| args: release --clean | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} | |
| - name: Set up Cloudsmith CLI | |
| uses: cloudsmith-io/cloudsmith-cli-action@v2 | |
| with: | |
| api-key: ${{ secrets.CLOUDSMITH_API_KEY }} | |
| # CLOUDSMITH_REPO must be <org-slug>/<repo-slug> from your Cloudsmith repository. | |
| - name: Publish packages to Cloudsmith | |
| env: | |
| CLOUDSMITH_REPO: kooler/mdc | |
| run: | | |
| for f in dist/*.deb; do | |
| cloudsmith push deb "$CLOUDSMITH_REPO/any-distro/any-version" "$f" | |
| done | |
| for f in dist/*.rpm; do | |
| cloudsmith push rpm "$CLOUDSMITH_REPO/any-distro/any-version" "$f" | |
| done |