Files
opengenesislinkserver/.github/workflows/publish-0.9.3.13-dev.yml
T

90 lines
3.9 KiB
YAML

name: Publish OpenGenesisLINK 0.9.3.13 Dev Pre-release
# Publish only a successful NexVerse CI push to main; never promote Dev to Stable.
on:
workflow_run:
workflows: ["NexVerse CI"]
types: [completed]
branches: [main]
permissions:
contents: write
jobs:
publish:
name: Publish immutable 0.9.3.13 Dev pre-release
if: >-
${{ vars.OGL_GEN1_NET10_RELEASE_APPROVED == 'true' &&
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'push' &&
github.event.workflow_run.head_branch == 'main' &&
github.event.workflow_run.head_repository.full_name == github.repository }}
runs-on: ubuntu-latest
steps:
- name: Checkout exact successful main CI SHA
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha }}
persist-credentials: false
- name: Verify Dev-only release identity and configuration
id: release_check
env:
RELEASE_SHA: ${{ github.event.workflow_run.head_sha }}
shell: bash
run: |
set -euo pipefail
test "$(git rev-parse HEAD)" = "$RELEASE_SHA"
if ! grep -Fq 'public const string VersionNumber = "0.9.3.13";' OpenSim/Framework/VersionInfo.cs; then
echo "::notice::Main does not match 0.9.3.13; skip historical Dev publisher."
echo 'eligible=false' >> "$GITHUB_OUTPUT"
exit 0
fi
if ! grep -Fq 'public const Flavour VERSION_FLAVOUR = Flavour.Dev;' OpenSim/Framework/VersionInfo.cs; then
echo "::notice::Version is not Dev; skip Dev publisher."
echo 'eligible=false' >> "$GITHUB_OUTPUT"
exit 0
fi
grep -Fq 'public const string AssemblyVersionNumber = "0.9.3.13";' OpenSim/Framework/VersionInfo.cs
test -s doc/NexVerse/RELEASE_0.9.3.13_DEV.md
test -s doc/NexVerse/09313_RELEASE_ACCEPTANCE.md
grep -Fq 'NodeId = "${Environment|NEXVERSE_NODE_ID}"' bin/OpenSim.ini
grep -Fq 'OGLExtendedRegionVisibility = true' bin/OpenSim.ini
grep -Fq 'OGLIarLiveProgress = true' bin/OpenSim.ini
grep -Fq 'FastMapAsyncStartup = true' bin/OpenSim.ini
grep -Fq 'GroupLandApiKey = "${Environment|NEXVERSE_GROUP_LAND_API_KEY}"' bin/OpenSim.ini
grep -Fq 'OGLExtendedRegionVisibility = false' bin/OpenSim.ini.example
grep -Fq 'FastMapAsyncStartup = false' bin/OpenSim.ini.example
grep -Fq '**Release-Typ:** Dev/Pre-release' doc/NexVerse/RELEASE_0.9.3.13_DEV.md
python3 tools/release/ogl_09313_acceptance_gate.py --self-test
echo 'eligible=true' >> "$GITHUB_OUTPUT"
- name: Publish prerelease without rewriting any tag
if: steps.release_check.outputs.eligible == 'true'
env:
GH_TOKEN: ${{ github.token }}
RELEASE_SHA: ${{ github.event.workflow_run.head_sha }}
shell: bash
run: |
set -euo pipefail
tag="v0.9.3.13-dev"
main_sha="$(gh api "repos/$GITHUB_REPOSITORY/commits/main" --jq '.sha')"
if [ "$main_sha" != "$RELEASE_SHA" ]; then
echo "::notice::main moved; refuse release from an outdated SHA."
exit 0
fi
if gh release view "$tag" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
echo "0.9.3.13 Dev release already exists. No overwrite."
exit 0
fi
if gh api "repos/$GITHUB_REPOSITORY/git/ref/tags/$tag" >/dev/null 2>&1; then
echo "::error::Tag already exists without a release; refusing to reuse."
exit 1
fi
gh release create "$tag" \
--repo "$GITHUB_REPOSITORY" \
--target "$RELEASE_SHA" \
--title "OpenGenesisLINK 0.9.3.13 Dev" \
--notes-file doc/NexVerse/RELEASE_0.9.3.13_DEV.md \
--prerelease