File tree Expand file tree Collapse file tree 2 files changed +40
-3
lines changed Expand file tree Collapse file tree 2 files changed +40
-3
lines changed Original file line number Diff line number Diff line change @@ -13,12 +13,12 @@ name: "CodeQL"
1313
1414on :
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 :
Original file line number Diff line number Diff line change 77 tags :
88 - ' v*'
99
10+ env :
11+ GO111MODULE : off
12+
1013jobs :
1114 build :
1215 runs-on : ubuntu-latest
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
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
You can’t perform that action at this time.
0 commit comments