Skip to content
This repository has been archived by the owner on May 13, 2021. It is now read-only.

Commit

Permalink
feat(CI) add goreleaser.yml
Browse files Browse the repository at this point in the history
Signed-off-by: Ziming Zhang <[email protected]>
  • Loading branch information
bitsf committed Sep 29, 2020
1 parent e59b2ea commit 14abb10
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
on:
push:
tags:
- 'v*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Unshallow
# required for the changelog to work correctly
run: git fetch --prune --unshallow
-
name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.13
-
name: prepare changelog
run: |
tag=${{ github.ref }}
tag=${tag##*/}
cat <<EOF | tee /tmp/release.txt
## Docker images
- \`docker pull goharbor/harbor-cluster-operator:$tag\`
EOF
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: v0.129.0
args: release --rm-dist --release-footer /tmp/release.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
on:
release:
types:
- created
- published

jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# opspresso/action-docker use body of ./target/TAG_NAME as docker tag
# https://github.com/opspresso/action-docker#common-env
- run: mkdir ./target
- run: echo -n '${{ github.ref }}' | sed 's|refs/tags/||' > ./target/TAG_NAME
- name: Docker Build & Push to Docker Hub
uses: opspresso/action-docker@master
with:
args: --docker
env:
USERNAME: '${{ secrets.DOCKER_USER }}'
PASSWORD: '${{ secrets.DOCKER_TOKEN }}'
LATEST: 'false'

0 comments on commit 14abb10

Please sign in to comment.