Skip to content

Commit 0baa997

Browse files
committed
chore(ci): publish deb and rpm packages on Cloudsmith
1 parent c3dbc95 commit 0baa997

File tree

4 files changed

+46
-1
lines changed

4 files changed

+46
-1
lines changed

.github/workflows/tag.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,25 @@ jobs:
1313
uses: actions/checkout@v2
1414
with:
1515
fetch-depth: 0
16+
17+
- name: Install Cloudsmith CLI
18+
run: pip install cloudsmith-cli==0.31.1
19+
1620
- name: Set up Go
1721
uses: actions/setup-go@v2
1822
with:
1923
go-version: 1.16
24+
2025
- name: Run GoReleaser
2126
uses: goreleaser/goreleaser-action@v2
2227
with:
2328
distribution: goreleaser
2429
version: latest
2530
args: release --rm-dist
2631
env:
32+
# To publish the release on GitHub
2733
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
# To publish on the Homebrew tap
2835
PAT_GITHUB: ${{ secrets.PAT_GITHUB }}
36+
# To publish on Cloudsmith
37+
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}

.goreleaser.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ builds:
1717
# Default build flags is `-s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser`.
1818

1919
nfpms:
20-
- formats:
20+
- id: deb_rpm
21+
formats:
2122
- deb
2223
- rpm
2324
dependencies:
@@ -70,3 +71,11 @@ brews:
7071
commit_msg_template: "Brew formula update for {{ .ProjectName }} version {{ .Tag }}"
7172
folder: Formula
7273
description: "src-fingerprint is a CLI util to easily compute the fileshas associated to a set of git repositories."
74+
75+
publishers:
76+
- name: cloudsmith
77+
ids:
78+
- deb_rpm
79+
cmd: "scripts/goreleaser-cloudsmith-publisher {{ .Version }} {{ abs .ArtifactPath }}"
80+
env:
81+
- CLOUDSMITH_API_KEY={{ .Env.CLOUDSMITH_API_KEY }}

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ brew tap gitguardian/tap
3838
brew install src-fingerprint
3939
```
4040

41+
### Linux packages
42+
43+
Deb and RPM packages are available on [Cloudsmith](https://cloudsmith.io/~gitguardian/repos/src-fingerprint/packages/).
44+
45+
Setup instructions:
46+
47+
- [Deb packages](https://cloudsmith.io/~gitguardian/repos/src-fingerprint/setup/#formats-deb)
48+
- [RPM packages](https://cloudsmith.io/~gitguardian/repos/src-fingerprint/setup/#formats-rpm)
49+
4150
### From the sources
4251

4352
You need `go` installed and `GOBIN` in your `PATH`. Once that is done, run the
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
version="$1"
5+
artifact_path="$2"
6+
7+
case "$artifact_path" in
8+
*.deb)
9+
cloudsmith push deb gitguardian/src-fingerprint/any-distro/any-version "$artifact_path"
10+
;;
11+
*.rpm)
12+
cloudsmith push rpm gitguardian/src-fingerprint/any-distro/any-version "$artifact_path"
13+
;;
14+
*)
15+
echo "Unsupported artifact format '$artifact_path'"
16+
exit 1
17+
;;
18+
esac

0 commit comments

Comments
 (0)