WIP: initial poc of publishing workflows #5
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: 'Publish (Java): SNAPSHOT' | |
| # on: | |
| # push: | |
| # branches: [ main ] | |
| # tags-ignore: | |
| # - "[0-9]+.[0-9]+.[0-9]+(-[0-9a-z]+)?" | |
| # paths-ignore: | |
| # - 'docs/**' | |
| # - 'scripts/**' | |
| # - '.github/pull_request_template.md' | |
| # - '.gitignore' | |
| # - 'gradlew' | |
| # - 'gradlew.bat' | |
| # - '**.adoc' | |
| # - '*.txt' | |
| on: | |
| pull_request: | |
| types: [opened, reopened, synchronize] | |
| jobs: | |
| build: | |
| name: Publish Java libs (${{ matrix.os_version }} swift:${{ matrix.swift_version }} jdk:${{ matrix.jdk_version }}-${{ matrix.jdk_vendor }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| swift_version: ['6.1.3'] | |
| os_version: ['jammy'] | |
| jdk_vendor: ['corretto'] | |
| jdk_version: [ 17, 24] | |
| container: | |
| image: ${{ (contains(matrix.swift_version, 'nightly') && 'swiftlang/swift') || 'swift' }}:${{ matrix.swift_version }}-${{ matrix.os_version }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Check NO SNAPSHOT version suffix | |
| run: if [[ $(cat gradle.properties | grep version= | sed 's/^version=//') =~ .*-SNAPSHOT ]]; then exit 1; else exit 0; fi | |
| - name: Prepare CI Environment | |
| uses: ./.github/actions/prepare_env | |
| - name: Make gradlew Executable | |
| run: chmod +x gradlew | |
| - name: Clean Gradle project | |
| run: ./gradlew --parallel clean | |
| # TODO: run tests here | |
| - name: Publish with Gradle | |
| env: | |
| ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }} | |
| ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }} | |
| SONATYPE_USER: ${{ secrets.SONATYPE_USER }} | |
| SONATYPE_TOKEN: ${{ secrets.SONATYPE_TOKEN }} | |
| run: | | |
| # Execute the gradle command to publish the project | |
| ./gradlew --no-daemon --no-parallel publish | |
| - name: Publish Test Results | |
| if: always() | |
| uses: scacap/action-surefire-report@5609ce4db72c09db044803b344a8968fd1f315da | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| report_paths: '**/build/test-results/test/TEST-*.xml' | |
| check_name: Test Report JDK ${{ matrix.jdk_version }} | |
| - name: Publish Checkstyle Report | |
| if: always() | |
| uses: jwgmeligmeyling/checkstyle-github-action@50292990e18466f2c5d95d04ff5fab931254fa5f | |
| with: | |
| name: Checkstyle Report JDK ${{ matrix.jdk_version }} | |
| path: '**/build/reports/checkstyle/*.xml' | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Publish PMD Report | |
| if: always() | |
| uses: jwgmeligmeyling/pmd-github-action@322e346bd76a0757c4d54ff9209e245965aa066d | |
| with: | |
| name: PMD Report JDK ${{ matrix.jdk_version }} | |
| path: '**/build/reports/pmd/*.xml' | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Publish SpotBugs Report | |
| if: always() | |
| uses: jwgmeligmeyling/spotbugs-github-action@b8e2c3523acb34c87f14e18cbcd2d87db8c8584e | |
| with: | |
| name: SpotBugs Report JDK ${{ matrix.jdk_version }} | |
| path: '**/build/reports/spotbugs/*.xml' | |
| token: ${{ secrets.GITHUB_TOKEN }} |