Merge pull request #112 from cybozu-go/bump-1.17.0 #35
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: | |
build: | |
name: Release | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup golang | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: go.mod | |
- name: Build binaries | |
run: make install GOBIN=`pwd`/docker | |
- name: Build setup-hw image | |
run: | | |
docker build -t ghcr.io/cybozu-go/setup-hw:latest --target stage1 docker | |
docker build -t ghcr.io/cybozu-go/setup-hw-secret:latest docker | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push images | |
run: | | |
tag=${GITHUB_REF#refs/tags/v} | |
for name in setup-hw setup-hw-secret; do | |
echo "pushing ${name}:v${tag} ..." | |
docker tag ghcr.io/cybozu-go/${name}:latest ghcr.io/cybozu-go/${name}:$tag | |
if ! echo $tag | grep -q -e '-'; then docker push ghcr.io/cybozu-go/${name}:latest; fi | |
docker push ghcr.io/cybozu-go/${name}:$tag | |
done | |
- name: Create release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
tagname="${GITHUB_REF#refs/tags/}" | |
if echo ${{ github.ref }} | grep -q -e '-'; then prerelease=-p; fi | |
gh release create -t "Release $tagname" $prerelease \ | |
-n "See [CHANGELOG.md](./CHANGELOG.md) for details." \ | |
"$tagname" |