Skip to content

prepare release: update docs&bump version (#1636) #35

prepare release: update docs&bump version (#1636)

prepare release: update docs&bump version (#1636) #35

Workflow file for this run

name: Pre-Release CI
on:
push:
tags:
- 'v*.*.*-rc.*'
jobs:
validate:
name: Validate Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Validate Tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# This step validates that the tag is a pre-release
run: |
prerelease=$(gh release view ${GITHUB_REF_NAME} --json isPrerelease | jq -r '.isPrerelease')
if [ "$prerelease" != "true" ]; then
echo "Tag is not a pre-release"
exit 1
fi
- name: Validate VERSION
run: |
version=$(cat cmd/thor/VERSION)
tag="${GITHUB_REF_NAME}"
tag="${tag#v}" # Remove the "v" prefix from the tag
tag="${tag%%-rc.*}" # Remove the "-rc.*" suffix from the tag
if [ "$tag" != "$version" ]; then
echo "VERSION file does not match tag"
exit 1
fi
- name: Validate API Version
run: |
thor_version=$(cat cmd/thor/VERSION)
api_version=$(grep -o 'version: [0-9][0-9.]*' api/doc/thor.yaml | awk '{print $2}')
if [ "$thor_version" != "$api_version" ]; then
echo "API spec version ($api_version) does not match Thor version ($thor_version)"
exit 1
fi
- name: Validate Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# This step validates that the tag is an official release
run: |
prerelease=$(gh release view ${GITHUB_REF_NAME} --json isPrerelease | jq -r '.isPrerelease')
if [ "$prerelease" != "true" ]; then
echo "Tag is not a release candidate"
exit 1
fi
publish-docker-image:
name: Publish Pre-Release Docker Image
uses: ./.github/workflows/publish-docker-images.yaml
secrets: inherit
needs:
- validate
permissions:
contents: read
packages: write
with:
environment: docker-publish
images: |
${{ github.repository }}
ghcr.io/${{ github.repository }}
tags: |
type=raw,value=${{ github.ref_name }}
publish-binaries:
name: Publish Binaries
uses: ./.github/workflows/release-binaries.yaml
secrets: inherit
needs:
- validate
permissions:
contents: write
packages: write
with:
binary: 'thor'