diff options
| author | Tong Sun <[email protected]> | 2021-12-18 16:10:43 -0500 |
|---|---|---|
| committer | Tong Sun <[email protected]> | 2021-12-18 16:10:43 -0500 |
| commit | ed1b03f99d79b4a4ecd499d1d4636402343193e3 (patch) | |
| tree | 16105928e9f1252944cda184f603021c8a3c7457 | |
| parent | - [#] update README (diff) | |
| download | html2md-0.2.2.tar.xz html2md-0.2.2.zip | |
- [+] publishing to central cloudsmith repov0.2.2
| -rw-r--r-- | .github/workflows/go-release-build.yml | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/.github/workflows/go-release-build.yml b/.github/workflows/go-release-build.yml index bc99dad..cfedab9 100644 --- a/.github/workflows/go-release-build.yml +++ b/.github/workflows/go-release-build.yml @@ -18,6 +18,12 @@ jobs: go-version: 1.15 - + name: Install Cloudsmith CLI + run: pip install --upgrade cloudsmith-cli + # Cloudsmith CLI tooling for pushing releases + # See https://help.cloudsmith.io/docs/cli + + - name: Checkout uses: actions/checkout@v2 with: @@ -43,3 +49,31 @@ jobs: args: release --rm-dist env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # Publish to cloudsmith repo + - + name: Publish package to cloudsmith + if: success() && startsWith(github.ref, 'refs/tags/') + env: + CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} + run: | + for filepath in dist/*; do + echo "== Analyzing '$filepath' for publishing" + filename=$(basename -- "$filepath") + extension="${filename##*.}" + filename="${filename%.*}" + case "$extension" in + 'apk') + echo "Pushing '$filepath' to cloudsmith repo" + cloudsmith push alpine suntong/repo/alpine/any-version $filepath + ;; + 'deb' | 'rpm') + echo "Pushing '$filepath' to cloudsmith repo" + cloudsmith push $extension suntong/repo/any-distro/any-version $filepath + ;; + *) + echo "File .$extension skipped publishing" + echo + ;; + esac + done |