|
| 1 | +name: Release Publisher |
| 2 | +on: |
| 3 | + push: |
| 4 | + tags: |
| 5 | + - "[0-9]+.[0-9]+.[0-9]+(-[0-9a-z]+)?" |
| 6 | +jobs: |
| 7 | + build: |
| 8 | + name: Release JDK (${{ matrix.os_version }} swift:${{ matrix.swift_version }} jdk:${{matrix.jdk_vendor}}) |
| 9 | + runs-on: ubuntu-latest |
| 10 | + strategy: |
| 11 | + fail-fast: false |
| 12 | + matrix: |
| 13 | + swift_version: ['6.1.3'] |
| 14 | + os_version: ['jammy'] |
| 15 | + jdk_vendor: ['corretto'] |
| 16 | + java: ['25'] |
| 17 | + container: |
| 18 | + image: ${{ (contains(matrix.swift_version, 'nightly') && 'swiftlang/swift') || 'swift' }}:${{ matrix.swift_version }}-${{ matrix.os_version }} |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v5 |
| 21 | + - name: Check NO SNAPSHOT version suffix |
| 22 | + run: if [[ $(cat gradle.properties | grep version= | sed 's/^version=//') =~ .*-SNAPSHOT ]]; then exit 1; else exit 0; fi |
| 23 | + - name: Prepare CI Environment |
| 24 | + uses: ./.github/actions/prepare_env |
| 25 | + - name: Set up jdk:${{matrix.jdk_vendor}} ${{matrix.java}} |
| 26 | + uses: actions/setup-java@v5 |
| 27 | + with: |
| 28 | + java-version: ${{ matrix.java }} |
| 29 | + distribution: ${{ matrix.jdk_vendor }} |
| 30 | + cache: 'gradle' |
| 31 | + - name: Print JDK Version |
| 32 | + run: java -version |
| 33 | + - name: Make gradlew Executable |
| 34 | + run: chmod +x gradlew |
| 35 | + - name: Clean Gradle project |
| 36 | + run: ./gradlew --parallel clean |
| 37 | + - name: Build with Gradle |
| 38 | + env: |
| 39 | + ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }} |
| 40 | + ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }} |
| 41 | + SONATYPE_USER: ${{ secrets.SONATYPE_USER }} |
| 42 | + SONATYPE_TOKEN: ${{ secrets.SONATYPE_TOKEN }} |
| 43 | + run: | |
| 44 | + # Build arguments to feed to the single gradlew publish command |
| 45 | + FIRST_GRADLE_TARGETS=" check" |
| 46 | + SECOND_GRADLE_TARGETS=" --no-parallel publish" |
| 47 | +
|
| 48 | + # Execute the gradlew command to publish the build |
| 49 | + sudo -E env "PATH=$PATH" bash -c "ulimit -l 65536 && ulimit -a && ./gradlew --no-daemon --parallel -PreleaseBuild=true$FIRST_GRADLE_TARGETS && ./gradlew --no-daemon --no-parallel -PreleaseBuild=true$SECOND_GRADLE_TARGETS" |
| 50 | + - name: Central Portal manual Repo Close |
| 51 | + # Details at https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#configuring-the-repository |
| 52 | + env: |
| 53 | + SONATYPE_USER: ${{ secrets.SONATYPE_USER }} |
| 54 | + SONATYPE_TOKEN: ${{ secrets.SONATYPE_TOKEN }} |
| 55 | + run: | |
| 56 | + BEARER_TOKEN=$(printf "$SONATYPE_USER:$SONATYPE_TOKEN" | base64) |
| 57 | + curl -i --retry 5 -H "Authorization: Bearer $BEARER_TOKEN" -X POST https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/io.servicetalk |
| 58 | + echo '********************************************************************************************' |
| 59 | + echo '* *' |
| 60 | + echo "* Go to https://central.sonatype.com/publishing/deployments to finish publishing artifacts *" |
| 61 | + echo '* *' |
| 62 | + echo '********************************************************************************************' |
| 63 | + - name: Publish Test Results |
| 64 | + if: always() |
| 65 | + uses: scacap/action-surefire-report@5609ce4db72c09db044803b344a8968fd1f315da |
| 66 | + with: |
| 67 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 68 | + report_paths: '**/build/test-results/test/TEST-*.xml' |
| 69 | + check_name: Test Report JDK ${{ matrix.java }} |
| 70 | + - name: Publish Checkstyle Report |
| 71 | + if: always() |
| 72 | + uses: jwgmeligmeyling/checkstyle-github-action@50292990e18466f2c5d95d04ff5fab931254fa5f |
| 73 | + with: |
| 74 | + name: Checkstyle Report JDK ${{ matrix.java }} |
| 75 | + path: '**/build/reports/checkstyle/*.xml' |
| 76 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 77 | + - name: Publish PMD Report |
| 78 | + if: always() |
| 79 | + uses: jwgmeligmeyling/pmd-github-action@322e346bd76a0757c4d54ff9209e245965aa066d |
| 80 | + with: |
| 81 | + name: PMD Report JDK ${{ matrix.java }} |
| 82 | + path: '**/build/reports/pmd/*.xml' |
| 83 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 84 | + - name: Publish SpotBugs Report |
| 85 | + if: always() |
| 86 | + # v1.2 |
| 87 | + uses: jwgmeligmeyling/spotbugs-github-action@b8e2c3523acb34c87f14e18cbcd2d87db8c8584e |
| 88 | + with: |
| 89 | + name: SpotBugs Report JDK ${{ matrix.java }} |
| 90 | + path: '**/build/reports/spotbugs/*.xml' |
| 91 | + token: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments