-
Notifications
You must be signed in to change notification settings - Fork 89
91 lines (90 loc) · 4.42 KB
/
ci-release.yml
File metadata and controls
91 lines (90 loc) · 4.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: 'Publish (Java): RELEASE'
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+(-[0-9a-z]+)?"
jobs:
build:
name: Release JDK (${{ matrix.os_version }} swift:${{ matrix.swift_version }} jdk:${{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: [ 24, 17 ]
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: Set up jdk:${{matrix.jdk_vendor}} ${{matrix.java}}
uses: actions/setup-java@v5
with:
java-version: ${{ matrix.java }}
distribution: ${{ matrix.jdk_vendor }}
cache: 'gradle'
- name: Print JDK Version
run: java -version
- name: Make gradlew Executable
run: chmod +x gradlew
- name: Clean Gradle project
run: ./gradlew --parallel clean
- name: Build 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: |
# Build arguments to feed to the single gradlew publish command
FIRST_GRADLE_TARGETS=" check"
SECOND_GRADLE_TARGETS=" --no-parallel publish"
# Execute the gradlew command to publish the build
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"
- name: Central Portal manual Repo Close
# Details at https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#configuring-the-repository
env:
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_TOKEN: ${{ secrets.SONATYPE_TOKEN }}
run: |
BEARER_TOKEN=$(printf "$SONATYPE_USER:$SONATYPE_TOKEN" | base64)
curl -i --retry 5 -H "Authorization: Bearer $BEARER_TOKEN" -X POST https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/io.servicetalk
echo '********************************************************************************************'
echo '* *'
echo "* Go to https://central.sonatype.com/publishing/deployments to finish publishing artifacts *"
echo '* *'
echo '********************************************************************************************'
- 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.java }}
- name: Publish Checkstyle Report
if: always()
uses: jwgmeligmeyling/checkstyle-github-action@50292990e18466f2c5d95d04ff5fab931254fa5f
with:
name: Checkstyle Report JDK ${{ matrix.java }}
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.java }}
path: '**/build/reports/pmd/*.xml'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish SpotBugs Report
if: always()
# v1.2
uses: jwgmeligmeyling/spotbugs-github-action@b8e2c3523acb34c87f14e18cbcd2d87db8c8584e
with:
name: SpotBugs Report JDK ${{ matrix.java }}
path: '**/build/reports/spotbugs/*.xml'
token: ${{ secrets.GITHUB_TOKEN }}