-
Notifications
You must be signed in to change notification settings - Fork 0
Add automated version sync workflow, harden CI/CD, and restructure README #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
773b20e
ci: harden Release workflow with concurrency and strict bash
WilliamAGH f3f1198
ci: add automated README version sync from Maven Central
WilliamAGH d77dfcc
docs: improve README with badges, ecosystem context, and Origin header
WilliamAGH ee0ada6
style(ci): normalize YAML formatting in CI workflow
WilliamAGH a6980fe
Add Context7 and DeepWiki badges to README
WilliamAGH 96f0ef5
docs: relocate badge assets and add project showcase
WilliamAGH 486e20f
docs(readme): add Other projects link to author section
WilliamAGH bc6ae67
fix(ci): restore contents permission for checkout and dependency subm…
WilliamAGH 61826a5
docs(readme): remove orphaned asterisk from quota section
WilliamAGH 4e54581
Bump project and dependency versions to 0.1.5
WilliamAGH File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| name: Update README version (Maven Central) | ||
|
|
||
| on: | ||
| # Keep README correct even if Central metadata lags a bit after release | ||
| schedule: | ||
| - cron: "23 6 * * *" # daily | ||
| workflow_dispatch: {} | ||
| # Best-effort: Central may lag behind a published GitHub release | ||
| release: | ||
| types: [published] | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| concurrency: | ||
| group: update-readme-version | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| update-readme: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Resolve latest release version from Maven Central metadata | ||
| id: resolve | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| GROUP_ID="com.williamcallahan" | ||
| ARTIFACT_ID="apple-maps-java" | ||
|
|
||
| METADATA_URL="https://repo1.maven.org/maven2/${GROUP_ID//.//}/${ARTIFACT_ID}/maven-metadata.xml" | ||
|
|
||
| echo "Fetching: ${METADATA_URL}" | ||
| XML="$(curl -fsSL "$METADATA_URL")" | ||
|
|
||
| # Extract <release>...</release> (fallback to <latest> if needed) | ||
| RELEASE="$(printf '%s' "$XML" | sed -n 's:.*<release>\(.*\)</release>.*:\1:p' | head -n 1 || true)" | ||
| if [[ -z "${RELEASE}" ]]; then | ||
| RELEASE="$(printf '%s' "$XML" | sed -n 's:.*<latest>\(.*\)</latest>.*:\1:p' | head -n 1 || true)" | ||
| fi | ||
|
|
||
| if [[ -z "${RELEASE}" ]]; then | ||
| echo "Failed to resolve release version from maven-metadata.xml" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Guardrail: don't ever write SNAPSHOT into README install snippets | ||
| if [[ "${RELEASE}" == *SNAPSHOT* ]]; then | ||
| echo "Resolved version is a SNAPSHOT (${RELEASE}); refusing to update README." | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "version=${RELEASE}" >> "$GITHUB_OUTPUT" | ||
| echo "Resolved release version: ${RELEASE}" | ||
|
|
||
| - name: Update README.md snippets | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| VERSION='${{ steps.resolve.outputs.version }}' | ||
|
|
||
| if [[ ! -f "README.md" ]]; then | ||
| echo "README.md not found at repo root" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Replace only the dependency coordinates/version lines in the documented snippets. | ||
| # This avoids rewriting unrelated occurrences of old versions elsewhere. | ||
| perl -0777 -i -pe ' | ||
| my $v = $ENV{VERSION}; | ||
|
|
||
| # Gradle snippet: implementation("group:artifact:VERSION") | ||
| s/(implementation\(\"com\.williamcallahan:apple-maps-java:)[^\"\)]+(\"\))/$1$v$2/g; | ||
|
|
||
| # Maven snippet: <version>VERSION</version> within the apple-maps-java dependency block | ||
| s#(<dependency>\s*<groupId>com\.williamcallahan</groupId>\s*<artifactId>apple-maps-java</artifactId>\s*<version>)[^<]+(</version>\s*</dependency>)#$1$v$2#gms; | ||
|
|
||
| ' README.md | ||
|
|
||
| echo "README.md updated to version ${VERSION}" | ||
|
|
||
| env: | ||
| VERSION: ${{ steps.resolve.outputs.version }} | ||
|
|
||
| - name: Detect changes | ||
| id: diff | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| if git diff --quiet -- README.md; then | ||
| echo "changed=false" >> "$GITHUB_OUTPUT" | ||
| echo "No changes to commit." | ||
| else | ||
| echo "changed=true" >> "$GITHUB_OUTPUT" | ||
| echo "README.md changed." | ||
| git --no-pager diff -- README.md | ||
| fi | ||
|
|
||
| - name: Commit and push | ||
| if: steps.diff.outputs.changed == 'true' | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| git config user.name "github-actions[bot]" | ||
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
|
|
||
| git add README.md | ||
| git commit -m "docs(readme): update dependency version to ${{ steps.resolve.outputs.version }}" | ||
| git push |
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
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.