Skip to content

Release 2.0.6

Release 2.0.6 #1665

Workflow file for this run

name: CI/CD
on:
push:
branches: [ "develop", "master" ]
pull_request:
branches: [ "develop", "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
# CESIUM_ION_TOKEN / GOOGLE_MAPS_API_KEY: baked into the public Pages bundle by
# generateTutorialApiKeys; lock at provider.
# Explicit module targets instead of the `build` aggregator: keeps the worldwind +
# worldwind-compose libraries (and their tests) the only thing validated against the
# `master` pre-publish gate, plus the tutorials JS bundle that ships to Pages. The
# codec modules build through publish-codecs.yml and are pulled into the tutorial JS
# bundle only via their Kotlin/JS NPM bindings — their native cmake chains never run
# here, regardless of whether cmake is on the runner.
env:
CESIUM_ION_TOKEN: ${{ secrets.CESIUM_ION_TOKEN }}
GOOGLE_MAPS_API_KEY: ${{ secrets.GOOGLE_MAPS_API_KEY }}
run: |
./gradlew \
:worldwind:build \
:worldwind-compose:build \
:worldwind-tutorials:jsBrowserDistribution
- name: Deploy Tutorials to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: worldwind-tutorials/build/dist/js/productionExecutable
CLEAN: true
- name: Check if worldwind.version is already on Maven Central
if: github.ref == 'refs/heads/master'
id: check-version
shell: bash
run: |
set -euo pipefail
VERSION=$(grep "^worldwind.version=" gradle.properties | cut -d= -f2)
URL="https://repo1.maven.org/maven2/earth/worldwind/worldwind/$VERSION/worldwind-$VERSION.pom"
if curl -sfL -o /dev/null "$URL"; then
echo "::notice::worldwind v$VERSION already on Maven Central — skipping publish (bump worldwind.version in gradle.properties to release a new version)."
echo "should_publish=false" >> "$GITHUB_OUTPUT"
else
echo "::notice::worldwind v$VERSION not yet on Maven Central — proceeding with publish."
echo "should_publish=true" >> "$GITHUB_OUTPUT"
fi
- name: Publish to Maven Central
if: github.ref == 'refs/heads/master' && steps.check-version.outputs.should_publish == 'true'
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PRIVATE_PASSWORD: ${{ secrets.GPG_PRIVATE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
run: |
./gradlew \
:worldwind:publishToSonatype \
:worldwind-compose:publishToSonatype \
closeSonatypeStagingRepository