generated from cybozu-go/neco-template
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (56 loc) · 1.94 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Release
on:
workflow_dispatch:
inputs:
tag:
type: string
required: true
description: The name of the tag to release
jobs:
release:
name: Release login-protector
runs-on: ubuntu-22.04
steps:
- name: Checkout main branch
uses: actions/checkout@v4
with:
ref: main
- uses: ./.github/actions/aqua
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}:${{ inputs.tag }}
labels: org.opencontainers.image.source=${{ github.repository }}
- name: Setup Git Config
run: |
git config --global user.name github-actions
git config --global user.email [email protected]
- name: Generate install.yaml and push tag
shell: bash -xe {0}
run: |
PROTECTOR_IMG=ghcr.io/${{ github.repository }}:${{ inputs.tag }} make build-installer
git checkout config/manager/kustomization.yaml
git add ./dist/install.yaml
if ! git diff --exit-code --quiet; then
git commit -m "Generate install.yaml for login-protector v${{ inputs.tag }}"
git push
fi
git tag -a v${{ inputs.tag }} -m "Release login-protector v${{ inputs.tag }}"
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create v${{ inputs.tag }} --title "Release login-protector v${{ inputs.tag }}" --generate-notes