diff --git a/.github/workflows/README.md b/.github/workflows/README.md new file mode 100644 index 00000000..1657e79a --- /dev/null +++ b/.github/workflows/README.md @@ -0,0 +1,19 @@ +# Workflows + +### Maven Tests +- Definition + - run `mvn clean install` +- Trigger + - on pull request / push to branch + +### Maven Release +- Definition + - run `mvn clean install` + - run `mvn release:prepare` + - run `mvn release:perform` + - push the release on gcs ua-ops-artifacts/airship-maven-artifacts +- Trigger + - on merge to Main/Master + - workflow_dispatch (manual trigger) + +📖 For full documentation on how these workflows and configuration files work, please refer to the [urbanairship/java-env repository](https://github.com/urbanairship/java-env#github-actions-and-workflows). \ No newline at end of file diff --git a/.github/workflows/maven-release.yaml b/.github/workflows/maven-release.yaml new file mode 100644 index 00000000..3e67c90a --- /dev/null +++ b/.github/workflows/maven-release.yaml @@ -0,0 +1,30 @@ +name: Perform Maven Release + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +on: + push: + branches: + - master + paths: + - 'pom.xml' + - '**/src/**' + - '**/pom.xml' + workflow_dispatch: + +jobs: + maven-release: + name: Maven Release + runs-on: [ self-hosted, ubuntu ] + + steps: + - id: release + uses: urbanairship/java-env/actions/airship-maven-release@master + with: + dry-run: false + java-build-sa-key: ${{ secrets.JAVA_BUILD_SA_KEY }} + gh-token: ${{ secrets.JAVA_BUILD_GH_TOKEN }} + additionalCommentPrefix: "[skip ci]" + additionalBuildArgs: "-Dgpg.passphrase=${{ secrets.MAVEN_GPG_PASSPHRASE }} -Dlocal.gpg.passphrase=${{ secrets.MAVEN_GPG_PASSPHRASE }}" diff --git a/.github/workflows/maven-tests.yaml b/.github/workflows/maven-tests.yaml new file mode 100644 index 00000000..255a2c22 --- /dev/null +++ b/.github/workflows/maven-tests.yaml @@ -0,0 +1,27 @@ +name: Maven Tests + +run-name: Maven Tests on branch ${{ github.ref_name }} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + pull_request: + branches: + - master + workflow_dispatch: + +jobs: + build: + runs-on: [self-hosted, ubuntu] + steps: + - name: Set up Airship Java Environment + uses: urbanairship/java-env/actions/setup-airship-java-env@master + with: + java-build-sa-key: ${{ secrets.JAVA_BUILD_SA_KEY }} + gh-token: ${{ secrets.JAVA_BUILD_GH_TOKEN }} + + - name: Build with Maven + shell: bash + run: mvn clean install -e -T 1C ${{ env.MAVEN_EXTRA_FLAGS }} diff --git a/config.ini b/config.ini new file mode 100644 index 00000000..bc60cbb9 --- /dev/null +++ b/config.ini @@ -0,0 +1,16 @@ +# ========================================================== +# PIPELINE CONFIGURATION (GitHub Actions / Local) +# ========================================================== +# This file is used by the CI/CD pipelines to set up the +# Java and Maven build environment, as well as Docker builds. +# ========================================================== + +[build] +# Java build version (required, default is 8) +java_build_version = 11 + +# Maven version (required, default is 3.9.9) +maven_version = 3.9.9 + +# Additional flags for maven (optional, e.g., -ntp -B -DskipTests) +maven_extra_flags =