File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1717 with :
1818 go-version : 1.15
1919
20+ -
21+ name : Install Cloudsmith CLI
22+ run : pip install --upgrade cloudsmith-cli
23+ # Cloudsmith CLI tooling for pushing releases
24+ # See https://help.cloudsmith.io/docs/cli
25+
2026 -
2127 name : Checkout
2228 uses : actions/checkout@v2
4349 args : release --rm-dist
4450 env :
4551 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
52+
53+ # Publish to cloudsmith repo
54+ -
55+ name : Publish package to cloudsmith
56+ if : success() && startsWith(github.ref, 'refs/tags/')
57+ env :
58+ CLOUDSMITH_API_KEY : ${{ secrets.CLOUDSMITH_API_KEY }}
59+ run : |
60+ for filepath in dist/*; do
61+ echo "== Analyzing '$filepath' for publishing"
62+ filename=$(basename -- "$filepath")
63+ extension="${filename##*.}"
64+ filename="${filename%.*}"
65+ case "$extension" in
66+ 'apk')
67+ echo "Pushing '$filepath' to cloudsmith repo"
68+ cloudsmith push alpine suntong/repo/alpine/any-version $filepath
69+ ;;
70+ 'deb' | 'rpm')
71+ echo "Pushing '$filepath' to cloudsmith repo"
72+ cloudsmith push $extension suntong/repo/any-distro/any-version $filepath
73+ ;;
74+ *)
75+ echo "File .$extension skipped publishing"
76+ echo
77+ ;;
78+ esac
79+ done
You can’t perform that action at this time.
0 commit comments