diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..c608239d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,32 @@ +name: Build + +on: + push: + branches: [master] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + # 8 is the release JDK; 17 and 21 catch annotation-processor and javac regressions. + java: ['8', '17', '21'] + name: build (JDK ${{ matrix.java }}) + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: ${{ matrix.java }} + cache: maven + + # The Codename One test runner in tests/javase starts the JavaSE port, which needs a display. + - name: Build and test + run: xvfb-run -a mvn -B install diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..52c377a7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,41 @@ +name: Release + +# Publishes to GitHub Packages when a version tag is pushed. update-version.sh creates the tag: +# bash update-version.sh 2.0.7 && git push origin master v2.0.7 +on: + push: + tags: ['v*'] + +permissions: + contents: read + packages: write + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '8' + cache: maven + server-id: github + server-username: GITHUB_ACTOR + server-password: GITHUB_TOKEN + + - name: Check the tag matches the project version + run: | + version=$(mvn -B -q help:evaluate -Dexpression=project.version -DforceStdout) + if [ "v${version}" != "${GITHUB_REF_NAME}" ]; then + echo "::error::Tag ${GITHUB_REF_NAME} does not match project version ${version}" + exit 1 + fi + + - name: Publish to GitHub Packages + run: > + xvfb-run -a mvn -B deploy + -DaltDeploymentRepository=github::default::https://maven.pkg.github.com/${{ github.repository }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/annotations/pom.xml b/annotations/pom.xml index 608fe8e4..7a8997c8 100644 --- a/annotations/pom.xml +++ b/annotations/pom.xml @@ -18,8 +18,8 @@ UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/pom.xml b/pom.xml index e8ebb0b0..417ff3c6 100644 --- a/pom.xml +++ b/pom.xml @@ -35,8 +35,8 @@ - 8.0-SNAPSHOT - 8.0-SNAPSHOT + 7.0.273 + 7.0.273 UTF-8 1.8 @@ -203,11 +203,24 @@ + - + + codenameone + https://repo.codenameone.com/maven2 + + false + + - + + codenameone-plugins + https://repo.codenameone.com/maven2 + + false + + diff --git a/tests/pom.xml b/tests/pom.xml index a0c73da3..b99d1a54 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -45,8 +45,6 @@ --> - 7.0.22 - 7.0.22 UTF-8 1.8