Skip to content

Commit cdf80e9

Browse files
committed
- [+] publishing to central cloudsmith repo
1 parent 7107b11 commit cdf80e9

File tree

2 files changed

+40
-3
lines changed

2 files changed

+40
-3
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ main ]
16+
# branches: [ main ]
1717
paths-ignore:
1818
- '**/*.md'
1919
pull_request:
2020
# The branches below must be a subset of the branches above
21-
branches: [ main ]
21+
# branches: [ main ]
2222
paths-ignore:
2323
- '**/*.md'
2424
schedule:

.github/workflows/go-release-build.yml

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
tags:
88
- 'v*'
99

10+
env:
11+
GO111MODULE: off
12+
1013
jobs:
1114
build:
1215
runs-on: ubuntu-latest
@@ -15,7 +18,13 @@ jobs:
1518
name: Set up Go
1619
uses: actions/setup-go@v2
1720
with:
18-
go-version: 1.15
21+
go-version: 1.16
22+
23+
-
24+
name: Install Cloudsmith CLI
25+
run: pip install --upgrade cloudsmith-cli
26+
# Cloudsmith CLI tooling for pushing releases
27+
# See https://help.cloudsmith.io/docs/cli
1928

2029
-
2130
name: Checkout
@@ -43,3 +52,31 @@ jobs:
4352
args: release --rm-dist
4453
env:
4554
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
56+
# Publish to cloudsmith repo
57+
-
58+
name: Publish package to cloudsmith
59+
if: success() && startsWith(github.ref, 'refs/tags/')
60+
env:
61+
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
62+
run: |
63+
for filepath in dist/*; do
64+
echo "== Analyzing '$filepath' for publishing"
65+
filename=$(basename -- "$filepath")
66+
extension="${filename##*.}"
67+
filename="${filename%.*}"
68+
case "$extension" in
69+
'apk')
70+
echo "Pushing '$filepath' to cloudsmith repo"
71+
cloudsmith push alpine suntong/repo/alpine/any-version $filepath
72+
;;
73+
'deb' | 'rpm')
74+
echo "Pushing '$filepath' to cloudsmith repo"
75+
cloudsmith push $extension suntong/repo/any-distro/any-version $filepath
76+
;;
77+
*)
78+
echo "File .$extension skipped publishing"
79+
echo
80+
;;
81+
esac
82+
done

0 commit comments

Comments
 (0)