Skip to content

Fixes up workflow and publish config to automatically release. #92

Fixes up workflow and publish config to automatically release.

Fixes up workflow and publish config to automatically release. #92

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v4
- name: Install JDK 11
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 11
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Test Plugin
run: ./gradlew -p focus-gradle-plugin clean check --no-daemon --stacktrace
- name: (Fail-only) Bundle test reports
if: failure()
run: find . -type d -name 'reports' | zip -@ -r build-reports.zip
- name: (Fail-only) Upload the build report
if: failure()
uses: actions/upload-artifact@v4
with:
name: error-report
path: build-reports.zip
publish:
runs-on: ubuntu-latest
if: github.repository == 'dropbox/focus' && github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
needs: [build]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install JDK 11
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 11
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Publish release
run: ./gradlew -p focus-gradle-plugin clean publishToMavenCentral --no-daemon --no-parallel --no-configuration-cache --stacktrace
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}