-
Notifications
You must be signed in to change notification settings - Fork 29
78 lines (76 loc) · 2.85 KB
/
update-zitadel.yml
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Update ZITADEL
on:
schedule:
- cron: '0 6 */1 * *'
workflow_dispatch:
inputs:
tag:
description: 'ZITADEL Tag'
required: false
jobs:
update:
runs-on: ubuntu-22.04
name: update zitadel api
steps:
- name: checkout source
uses: actions/checkout@v4
- name: check input tag
if: ${{github.event_name == 'workflow_dispatch'}}
id: check-input
run: |
INPUT=${{github.event.inputs.tag}}
if ! [[ ${INPUT} =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then
echo "supplied invalid version number: ${INPUT}!"
echo "must be of schema: vX.X.X"
exit 1
fi
echo "::set-output name=input::${INPUT}"
- name: get latest tag
id: latest-tag
uses: oprypin/find-latest-tag@v1
with:
repository: zitadel/zitadel
releases-only: true
# ignore prereleases
regex: '^v([0-9]+)\.([0-9]+)\.([0-9]+)$'
- name: set tag
id: tag
run: |
INPUT=${{steps.check-input.outputs.input}}
LATEST=${{steps.latest-tag.outputs.tag}}
TAG=${INPUT:-${LATEST}}
echo "input tag: ${INPUT}"
echo "latest tag: ${LATEST}"
echo "going to use: ${TAG}"
echo "::set-output name=tag::${TAG}"
- uses: tibdex/github-app-token@v2
id: generate-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
## Workaround until https://github.com/docker/build-push-action/issues/252#issuecomment-804898823 is merged
version: v0.6.0
buildkitd-flags: --debug
- name: Build
run: |
DOCKER_BUILDKIT=1 docker build -f build/zitadel/Dockerfile --build-arg TAG_NAME=${{steps.tag.outputs.tag}} . -o ./pkg/client
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ steps.generate-token.outputs.token }}
commit-message: 'fix: update zitadel api to ${{steps.tag.outputs.tag}}'
branch: update-api
delete-branch: true
title: 'fix: Update ZITADEL API to ${{steps.tag.outputs.tag}}'
body: |
Update report
- latest zitadel tag: [${{steps.latest-tag.outputs.tag}}](https://github.com/zitadel/zitadel/releases/tag/${{steps.latest-tag.outputs.tag}})
- checked out zitadel version: [${{steps.tag.outputs.tag}}](https://github.com/zitadel/zitadel/releases/tag/${{steps.tag.outputs.tag}})
- generated clients
- Auto-generated by [create-pull-request][1]
[1]: https://github.com/peter-evans/create-pull-request
draft: false
reviewers: 'livio-a,stebenz,eliobischof'