Fix marker bitmap lifecycle crash, add cache regression tests, and bu… #17
Workflow file for this run
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: Release to Maven Central | |
| on: | |
| push: | |
| tags: | |
| - "v*.*.*" | |
| permissions: | |
| contents: write # Needed to create GitHub releases | |
| jobs: | |
| format: | |
| name: Check Formatting | |
| uses: ./.github/workflows/_format.yml | |
| detekt: | |
| name: Static Analysis | |
| uses: ./.github/workflows/_detekt.yml | |
| test: | |
| name: Unit Tests | |
| needs: [format, detekt] | |
| uses: ./.github/workflows/_test.yml | |
| build-library: | |
| name: Build Library | |
| needs: [format, detekt, test] | |
| uses: ./.github/workflows/_build-library.yml | |
| build-examples: | |
| name: Build Examples | |
| needs: [format, detekt, test] | |
| uses: ./.github/workflows/_build-examples.yml | |
| publish: | |
| name: Publish to Maven Central | |
| runs-on: ubuntu-latest | |
| needs: [format, detekt, test, build-library, build-examples] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - name: Cache Gradle | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Grant execute permission for Gradle wrapper | |
| run: chmod +x gradlew | |
| - name: Validate tag format | |
| run: | | |
| TAG=${GITHUB_REF#refs/tags/} | |
| if [[ ! $TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
| echo "Invalid tag format. Use vMAJOR.MINOR.PATCH (e.g., v1.2.3)" | |
| exit 1 | |
| fi | |
| VERSION=$(echo $TAG | sed 's/^v//') | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| echo "TAG=$TAG" >> $GITHUB_ENV | |
| - name: Publish to Maven Central | |
| env: | |
| OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
| OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
| SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
| SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | |
| run: ./gradlew publishAggregationToCentralPortal | |
| - name: Generate changelog | |
| id: changelog | |
| run: | | |
| PREV_TAG=$(git describe --tags --abbrev=0 ${{ env.TAG }}^ 2>/dev/null || echo "") | |
| if [ -z "$PREV_TAG" ]; then | |
| echo "First release" | |
| CHANGELOG="Initial release of OpenMapView" | |
| else | |
| echo "Generating changelog from $PREV_TAG to ${{ env.TAG }}" | |
| CHANGELOG=$(git log ${PREV_TAG}..${{ env.TAG }} --pretty=format:"- %s (%h)" --no-merges) | |
| fi | |
| echo "changelog<<EOF" >> $GITHUB_OUTPUT | |
| echo "$CHANGELOG" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ env.TAG }} | |
| name: Release ${{ env.VERSION }} | |
| body: | | |
| # OpenMapView ${{ env.VERSION }} | |
| ## Changes | |
| ${{ steps.changelog.outputs.changelog }} | |
| ## Installation | |
| Add to your `settings.gradle.kts`: | |
| ```gradle | |
| dependencyResolutionManagement { | |
| repositories { | |
| mavenCentral() | |
| } | |
| } | |
| ``` | |
| Add to your `build.gradle.kts`: | |
| ```kotlin | |
| dependencies { | |
| implementation("de.afarber:openmapview:${{ env.VERSION }}") | |
| } | |
| ``` | |
| draft: false | |
| prerelease: false | |