diff --git a/.github/workflows/gitversion.yml b/.github/workflows/gitversion.yml index a081b63..7daf4e8 100644 --- a/.github/workflows/gitversion.yml +++ b/.github/workflows/gitversion.yml @@ -19,13 +19,7 @@ jobs: with: fetch-depth: 0 persist-credentials: false - - name: Install GitVersion - run: dotnet tool install GitVersion.Tool --tool-path "$RUNNER_TEMP/gitversion" --version 6.8.2 - - name: Calculate and validate version - shell: bash - run: | - set -euo pipefail - version="$("$RUNNER_TEMP/gitversion/dotnet-gitversion" /showvariable SemVer)" - test -n "$version" - echo "Calculated GitVersion SemVer: $version" - echo "### GitVersion: $version" >> "$GITHUB_STEP_SUMMARY" + - name: Calculate and validate version (shared platform) + uses: 4FusionLab/.github/.github/actions/resolve-version@ad9d60ba4aabc494b4f2c85d6c566a50ca423751 + with: + variable: SemVer diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e788c58..8706f21 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,13 +23,15 @@ jobs: with: fetch-depth: 0 persist-credentials: false - - run: python scripts/release_changes.py --self-test - - name: Detect addon changes - if: github.event_name == 'push' && github.ref == 'refs/heads/main' + - name: Detect runtime changes (shared platform) id: impact - env: - BEFORE: ${{ github.event.before }} - run: python scripts/release_changes.py --before "$BEFORE" --after "$GITHUB_SHA" --github-output "$GITHUB_OUTPUT" + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + uses: 4FusionLab/.github/.github/actions/runtime-changes@ad9d60ba4aabc494b4f2c85d6c566a50ca423751 + with: + before: ${{ github.event.before }} + after: ${{ github.sha }} + paths-file: .github/release-paths.txt + test: needs: changes outputs: @@ -44,21 +46,24 @@ jobs: - uses: actions/setup-python@v6 with: python-version: '3.11' - - name: Derive package version from GitVersion + - name: Resolve GitVersion (shared platform) id: version - shell: bash - run: | - set -euo pipefail - dotnet tool install GitVersion.Tool --tool-path "$RUNNER_TEMP/gitversion" --version 6.8.2 - version="$("$RUNNER_TEMP/gitversion/dotnet-gitversion" /showvariable MajorMinorPatch)" - [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] - echo "version=$version" >> "$GITHUB_OUTPUT" + uses: 4FusionLab/.github/.github/actions/resolve-version@ad9d60ba4aabc494b4f2c85d6c566a50ca423751 + - name: Check Python and package all platform ZIPs shell: bash run: | set -euo pipefail python -m unittest discover -s tests -v python scripts/package.py --version "${{ steps.version.outputs.version }}" + - name: Generate release notes for validation (shared platform) + if: github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.changes.outputs.release == 'true' + uses: 4FusionLab/.github/.github/actions/release-notes@ad9d60ba4aabc494b4f2c85d6c566a50ca423751 + with: + product: RuEn + version: ${{ steps.version.outputs.version }} + candidate: docs/releases/${{ steps.version.outputs.version }}.md + output: ${{ runner.temp }}/release-notes.md - name: Validate release candidate when runtime changed if: github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.changes.outputs.release == 'true' shell: bash @@ -66,8 +71,6 @@ jobs: VERSION: ${{ steps.version.outputs.version }} run: | set -euo pipefail - python scripts/release_notes.py --product RuEn --version "$VERSION" \ - --output "$RUNNER_TEMP/release-notes.md" --candidate "docs/releases/$VERSION.md" python scripts/release_contract.py --version "$VERSION" --tag "v$VERSION" \ --channel stable --manifest RuEn/RuEn.manifest \ --archive "dist/RuEn-$VERSION-universal.zip" \ @@ -101,6 +104,24 @@ jobs: with: name: RuEn-distributions path: dist + - name: Generate release notes for publication (shared platform) + uses: 4FusionLab/.github/.github/actions/release-notes@ad9d60ba4aabc494b4f2c85d6c566a50ca423751 + with: + product: RuEn + version: ${{ needs.test.outputs.version }} + candidate: docs/releases/${{ needs.test.outputs.version }}.md + output: ${{ runner.temp }}/release-notes.md + - name: Verify platform ZIPs (shared platform) + uses: 4FusionLab/.github/.github/actions/verify-archive@ad9d60ba4aabc494b4f2c85d6c566a50ca423751 + with: + product: RuEn + version: ${{ needs.test.outputs.version }} + archives: | + dist/RuEn-${{ needs.test.outputs.version }}-universal.zip + dist/RuEn-${{ needs.test.outputs.version }}-macos.zip + dist/RuEn-${{ needs.test.outputs.version }}-windows.zip + manifest: RuEn/RuEn.manifest + notes: ${{ runner.temp }}/release-notes.md - name: Verify packages and publish immutable release shell: bash env: @@ -109,8 +130,6 @@ jobs: run: | set -euo pipefail tag="v$VERSION" - python scripts/release_notes.py --product RuEn --version "$VERSION" \ - --output "$RUNNER_TEMP/release-notes.md" --candidate "docs/releases/$VERSION.md" python scripts/release_contract.py --version "$VERSION" --tag "$tag" \ --channel stable --manifest RuEn/RuEn.manifest \ --archive "dist/RuEn-$VERSION-universal.zip" \