Skip to content

Commit

Permalink
Simplify admin-tools release action
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanos committed Jun 13, 2024
1 parent 3487fd7 commit 67df23c
Showing 1 changed file with 7 additions and 37 deletions.
44 changes: 7 additions & 37 deletions .github/workflows/release-admin-tools.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,40 @@
name: Release Admin Tools Image
name: Release AdminTools Image

permissions: read-all

on:
workflow_dispatch:
inputs:
commit:
description: "Repo Commit sha"
type: string
description: "Commit sha"
required: true
patch:
description: "The patch version of the admintools image. This is added to the server version"
type: string
tag:
description: "The tag for the new image"
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:
retag-and-release:
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
- name: Copy admintools image
env:
COMMIT: ${{ github.event.inputs.commit }}
TAG: ${{ env.TAG }}
TAG: ${{ github.event.inputs.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/image_copy/main.go

0 comments on commit 67df23c

Please sign in to comment.