Release #36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
releaseVersion: | |
description: 'Release version' | |
required: true | |
nextVersion: | |
description: 'Next version' | |
required: true | |
defaults: | |
run: | |
shell: nix develop -v -c bash {0} | |
jobs: | |
release: | |
name: Release ${{ github.event.inputs.releaseVersion }} | |
runs-on: [self-hosted, nix, general, arm64-linux, small] | |
timeout-minutes: 5 | |
env: | |
IMAGE_REPOSITORY: public.ecr.aws/shopstic | |
RELEASE_VERSION: ${{ github.event.inputs.releaseVersion }} | |
NEXT_VERSION: ${{ github.event.inputs.nextVersion }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- id: determine-version | |
name: Determine current version | |
run: |- | |
CURRENT_VERSION=$(./release.sh get_release_version) || exit $? | |
echo "version=${CURRENT_VERSION}" >> $GITHUB_OUTPUT | |
- name: Push image manifest | |
env: | |
CURRENT_VERSION: ${{ steps.determine-version.outputs.version }} | |
run: |- | |
manifest-tool push from-args \ | |
--platforms linux/amd64,linux/arm64 \ | |
--template "${IMAGE_REPOSITORY}/toothpick-server:${CURRENT_VERSION}-ARCH" \ | |
--target "${IMAGE_REPOSITORY}/toothpick-server:${RELEASE_VERSION}" | |
- name: Build and push Helm Chart | |
run: |- | |
export HELM_REGISTRY_CONFIG=/home/runner/.docker/config.json | |
./release.sh push_helm_chart "${RELEASE_VERSION}" "${RELEASE_VERSION}" "oci://${IMAGE_REPOSITORY}/charts" | |
- name: Create git tag | |
run: |- | |
git config --global user.email "[email protected]" | |
git config --global user.name "CI Runner" | |
git tag "${RELEASE_VERSION}" | |
git push origin --tags | |
echo "ThisBuild / version := \"${NEXT_VERSION}-SNAPSHOT\"" > ./version.sbt | |
git commit -a -m "Bump version to ${NEXT_VERSION}-SNAPSHOT" | |
git push origin main |