[Android] [IssueReporter] Log internal error if failed to process JVM… #58
This file contains hidden or 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: Auto Release on Changelog Update | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - 'CHANGELOG.md' | |
| jobs: | |
| prepare-release: | |
| name: Extract version & check tag | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.extract.outputs.version }} | |
| should_release: ${{ steps.tagcheck.outputs.should_release }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # need tags | |
| - name: Extract version from CHANGELOG.md | |
| id: extract | |
| run: | | |
| second_h2_line=$(grep -E '^## \[' CHANGELOG.md | sed -n '2p') || true | |
| if [ -z "$second_h2_line" ]; then | |
| echo "Could not find second H2 header in CHANGELOG.md" >&2 | |
| exit 1 | |
| fi | |
| # Support optional prerelease (-rc.1, -beta, etc) and build metadata (+build.5) per SemVer, no leading 'v'. | |
| version=$(echo "$second_h2_line" | sed -E 's/^## \[([0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?)\].*/\1/') | |
| if ! [[ $version =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$ ]]; then | |
| echo "Parsed version '$version' is not a valid SEMVER" >&2 | |
| exit 1 | |
| fi | |
| echo "version=$version" >> "$GITHUB_OUTPUT" | |
| echo "Extracted version: $version" | |
| - name: Check if tag already exists | |
| id: tagcheck | |
| run: | | |
| version_tag="v${{ steps.extract.outputs.version }}" | |
| if git ls-remote --exit-code --tags origin "$version_tag" >/dev/null 2>&1; then | |
| echo "Tag $version_tag already exists. Skipping release." >&2 | |
| echo "should_release=false" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "Tag $version_tag does not exist. Will release." >&2 | |
| echo "should_release=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Emit skip notice | |
| if: steps.tagcheck.outputs.should_release == 'false' | |
| run: | | |
| echo "::notice title=Release skipped::Tag v${{ steps.extract.outputs.version }} already exists. No release will be created." | |
| run-release: | |
| name: Run Release workflow | |
| needs: prepare-release | |
| if: needs.prepare-release.outputs.should_release == 'true' | |
| permissions: | |
| id-token: write | |
| contents: write | |
| uses: ./.github/workflows/update_sdk_version.yaml | |
| with: | |
| version: ${{ needs.prepare-release.outputs.version }} | |
| emergency: false | |
| secrets: inherit | |
| no-release: | |
| name: No release (tag exists) | |
| needs: prepare-release | |
| if: needs.prepare-release.outputs.should_release == 'false' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Summary | |
| run: | | |
| echo "Tag v${{ needs.prepare-release.outputs.version }} already exists. Release workflow not invoked." >> $GITHUB_STEP_SUMMARY |