-
Notifications
You must be signed in to change notification settings - Fork 61
70 lines (65 loc) · 2.1 KB
/
release-admin-tools.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
name: Release Admin Tools Image
permissions: read-all
on:
workflow_dispatch:
inputs:
commit:
description: "Repo Commit sha"
type: string
required: true
patch:
description: "The patch version of the admintools image. This is added to the server version"
type: string
required: true
latest:
type: boolean
description: "Also update latest tag"
required: true
default: false
major:
type: boolean
description: "Also update major tag"
required: true
default: false
jobs:
release-admin-tools:
name: "Re-tag and release images"
runs-on: ubuntu-latest
steps:
# Main
- uses: actions/checkout@v4
# For the action itself
- name: Check out target commit
uses: actions/checkout@v4
with:
path: target
submodules: "true"
ref: ${{ github.event.inputs.commit }}
- uses: actions/setup-go@v5
with:
go-version-file: "src/go.mod"
- name: Calculate admintools tag
run: |
get_tag() {
# We need to remove the `shallow` marker for this submodule or else
# `git describe --tags` won't find our tags
cd "target/$1"
# We need to fetch the tags before git describe will do what we want
# We _only_ fetch the tags to save time
git fetch origin 'refs/tags/*:refs/tags/*' >&2
rm -f ../.git/modules/$1/shallow
git describe --tags --always | cut -d '-' -f-2
}
echo "TAG=$(get_tag temporal)-${{inputs.patch}}" >> "${GITHUB_ENV}"
- name: Copy images
env:
COMMIT: ${{ github.event.inputs.commit }}
TAG: ${{ env.TAG }}
USERNAME: ${{ secrets.DOCKER_USERNAME }}
PASSWORD: ${{ secrets.DOCKER_PAT }}
IMAGES: admin-tools
SRC_REPO: temporaliotest
DST_REPO: temporalio
LATEST: ${{ github.event.inputs.latest }}
MAJOR: ${{ github.event.inputs.major }}
run: go run src/release_temporal/main.go