aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorTong Sun <[email protected]>2023-05-02 12:45:54 -0400
committerTong Sun <[email protected]>2023-05-02 13:16:43 -0400
commit91033002f2b4dd7e361e5bb9b9e5e00274d72390 (patch)
treea8b8d38b4a8bf49bcf44df49ba54db7212734c49 /.github/workflows
parent- [#] use real test to replace dummy test (diff)
downloadhtml2md-91033002f2b4dd7e361e5bb9b9e5e00274d72390.tar.xz
html2md-91033002f2b4dd7e361e5bb9b9e5e00274d72390.zip
- [#] only install cloudsmith cli when necessary
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/go-release-build.yml18
1 files changed, 10 insertions, 8 deletions
diff --git a/.github/workflows/go-release-build.yml b/.github/workflows/go-release-build.yml
index 13393bd..150245d 100644
--- a/.github/workflows/go-release-build.yml
+++ b/.github/workflows/go-release-build.yml
@@ -21,12 +21,6 @@ jobs:
go-version: 1.19
-
- 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:
@@ -36,8 +30,9 @@ jobs:
name: Tests
run: |
export GOPATH=/home/runner/go
- mkdir -vp $GOPATH/src/github.com/$GITHUB_ACTOR
- mv -v $GITHUB_WORKSPACE $GOPATH/src/github.com/$GITHUB_ACTOR
+ mkdir -vp $GOPATH/src/github.com/$GITHUB_REPOSITORY
+ rmdir -v $GOPATH/src/github.com/$GITHUB_REPOSITORY
+ mv -v $GITHUB_WORKSPACE $GOPATH/src/github.com/$GITHUB_REPOSITORY
ln -vs $GOPATH/src/github.com/$GITHUB_REPOSITORY $GITHUB_WORKSPACE
# go mod tidy
go get -v ./...
@@ -54,6 +49,13 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ -
+ name: Install Cloudsmith CLI
+ if: success() && startsWith(github.ref, 'refs/tags/')
+ run: pip install --upgrade cloudsmith-cli
+ # Cloudsmith CLI tooling for pushing releases
+ # See https://help.cloudsmith.io/docs/cli
+
# Publish to cloudsmith repo
-
name: Publish package to cloudsmith