Files
release/check-is-not-released/action.yaml
David Übler 5f15803f5a
All checks were successful
run tests / check (push) Successful in 25s
run tests / release (push) Successful in 15s
WIP
2025-12-10 06:50:35 +01:00

49 lines
1.5 KiB
YAML

name: "check not released"
description: "ensure that there is no release with the current version"
inputs:
configure_runner_environment:
required: false
default: true
runs:
using: composite
steps:
- if: inputs.configure_runner_environment == 'true'
uses: https://gitea.puzzleyou.net/actions/configure-runner-environment@master
- name: declare project if neccessary
run: |
if [[ ! -z "${RELEASE_PROJECT_CURRENT_VERSION}" ]]; then
echo "already set up."
exit 0
fi
nix run ${{ github.action_path }} -- \
declare \
--release-yaml-filename ".gitea/release.yaml" \
--gitea-instance "https://gitea.puzzleyou.net" \
--release-repository-name "${{ github.repository }}" \
--release-ref-name "${{ github.ref_name }}" \
--release-run-number "${{ github.run_number }}" \
--release-commit-sha "${{ github.sha }}" \
--write-env-vars-to-filename "$GITHUB_ENV"
- name: check release state
run: |
set +e
nix run ${{ github.action_path }} -- \
dump \
--state "${RELEASE_ACTION_STATEFILE}" \
| grep "is already released: True"
IS_RELEASED_EXIT_CODE=$?
if [[ "$IS_RELEASED_EXIT_CODE" -eq 0 ]]; then
VERSION="$RELEASE_PROJECT_CURRENT_VERSION"
echo "Project is already released with version ${VERSION}."
exit -1
else
echo "Project is not yet released."
fi