Skip to content

Merge pull request #596 from cybozu-go/bump-v0.18.0 #42

Merge pull request #596 from cybozu-go/bump-v0.18.0

Merge pull request #596 from cybozu-go/bump-v0.18.0 #42

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
jobs:
build-moco:
name: Push Container Image
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: linux/amd64
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/cybozu-go/moco
flavor: latest=false
# ref. https://github.com/docker/metadata-action#typesemver
tags: |
type=semver,pattern={{version}}
- name: Build
id: docker_build
uses: docker/build-push-action@v3
with:
builder: ${{ steps.buildx.outputs.name }}
push: true
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
target: controller
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-moco-backup:
name: Push Container Image
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: linux/amd64
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/cybozu-go/moco-backup
flavor: latest=false
# ref. https://github.com/docker/metadata-action#typesemver
tags: |
type=semver,pattern={{version}}
- name: Build
id: docker_build
uses: docker/build-push-action@v3
with:
builder: ${{ steps.buildx.outputs.name }}
push: true
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
release:
name: Release on GitHub
needs: [build-moco, build-moco-backup]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: go.mod
- name: GoReleaser
# v3.2.0 https://github.com/goreleaser/goreleaser-action/releases/tag/v3.2.0
uses: goreleaser/goreleaser-action@b508e2e3ef3b19d4e4146d4f8fb3ba9db644a757
with:
distribution: goreleaser
version: v1.8.2
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update new version in krew-index
# v0.0.43 https://github.com/rajatjindal/krew-release-bot/releases/tag/v0.0.43
uses: rajatjindal/krew-release-bot@92da038bbf995803124a8e50ebd438b2f37bbbb0