Skip to content

Commit b5afacf

Browse files
Update CI workflow to publish releases to Cloudsmith (#26)
1 parent 55f5c12 commit b5afacf

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

Diff for: .github/workflows/ci.yml

+23-7
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,22 @@ jobs:
3434
GOEXPERIMENT: boringcrypto
3535
run: go test ./...
3636
-
37-
name: Build and Publish
37+
name: Build and Publish (Dry Run)
3838
uses: goreleaser/goreleaser-action@v3
39-
if: ${{ startsWith(github.ref, 'refs/tags/') }}
39+
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
4040
with:
4141
version: latest
42-
args: release --clean
42+
args: release --skip-publish --clean --snapshot
4343
env:
4444
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4545
GOEXPERIMENT: boringcrypto
4646
-
47-
name: Build and Publish (Dry Run)
47+
name: Build and Publish
4848
uses: goreleaser/goreleaser-action@v3
49-
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
49+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
5050
with:
5151
version: latest
52-
args: release --skip-publish --clean --snapshot
52+
args: release --clean
5353
env:
5454
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5555
GOEXPERIMENT: boringcrypto
@@ -74,7 +74,7 @@ jobs:
7474
name: Set up Docker Buildx
7575
uses: docker/setup-buildx-action@v2
7676
-
77-
name: Login to DockerHub
77+
name: Login to GitHub Container Registry
7878
if: github.event_name != 'pull_request'
7979
uses: docker/login-action@v2
8080
with:
@@ -89,6 +89,22 @@ jobs:
8989
tags: ghcr.io/${{ steps.meta.outputs.tags }}
9090
labels: ${{ steps.meta.outputs.labels }}
9191
platforms: linux/amd64,linux/arm64
92+
-
93+
name: Login to Cloudsmith Registry
94+
if: github.event_name != 'pull_request'
95+
uses: docker/login-action@v2
96+
with:
97+
registry: docker.eventstore.com
98+
username: ${{ secrets.CLOUDSMITH_CICD_USER }}
99+
password: ${{ secrets.CLOUDSMITH_CICD_TOKEN }}
100+
-
101+
name: Push to Cloudsmith
102+
uses: docker/build-push-action@v3
103+
with:
104+
push: ${{ github.event_name != 'pull_request' }}
105+
tags: docker.eventstore.com/${{ steps.meta.outputs.tags }}
106+
labels: ${{ steps.meta.outputs.labels }}
107+
platforms: linux/amd64,linux/arm64
92108

93109
test-windows:
94110
runs-on: windows-latest

0 commit comments

Comments
 (0)