Merge pull request #11 from cybozu-go/bump-0.4.0 #5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
image: | |
name: Push Container image | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/setup-buildx-action@v3 | |
- run: make docker-build | |
- name: Login to ghcr.io | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push to ghcr.io | |
run: | | |
IMAGE_TAG=${GITHUB_REF#refs/tags/v} # Remove "v" prefix. | |
docker tag zombie-detector:dev ghcr.io/cybozu-go/zombie-detector:$IMAGE_TAG | |
docker push ghcr.io/cybozu-go/zombie-detector:$IMAGE_TAG | |
release: | |
name: Release on GitHub | |
needs: image | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Create release | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: |- | |
VERSION=${GITHUB_REF#refs/tags/} # Don't remove "v" prefix. | |
if echo ${VERSION} | grep -q -e '-'; then PRERELEASE_FLAG=-p; fi | |
gh release create $VERSION $PRERELEASE_FLAG \ | |
-t "Release $VERSION" \ | |
-n "See [CHANGELOG.md](./CHANGELOG.md) for details." |