-
Notifications
You must be signed in to change notification settings - Fork 3
79 lines (76 loc) · 2.82 KB
/
sdk_publish.yaml
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
name: "04 - Publish to Maven Central and GitHub Release"
"on":
push:
branches:
- main
paths:
- RELEASES.md
- '*/RELEASES.md'
jobs:
test_and_lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/gradle-build-action@v3
- uses: open-policy-agent/setup-opa@v2
- run: ./gradlew test lint checkstyleMain checkstyleTest
- run: ./scripts/check-version-mismatch.sh
publish:
name: Publish Java SDK
runs-on: ubuntu-latest
steps:
- name: Tune GitHub-hosted runner network
uses: smorimoto/tune-github-hosted-runner-network@v1
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: "11"
distribution: "corretto"
cache: "gradle"
- name: Publish to Sonatype (legacy)
run: |-
pwd
./gradlew publish -x autoLintGradle --no-daemon
env:
MAVEN_USERNAME: ${{ secrets.ossrh_username }}
MAVEN_PASSWORD: ${{ secrets.ossrh_password }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.java_gpg_secret_key }}
ORG_GRADLE_PROJECT_signingPassphrase: ${{ secrets.java_gpg_passphrase }}
- uses: ravsamhq/notify-slack-action@v2
if: always() && env.SLACK_WEBHOOK_URL != ''
with:
status: ${{ job.status }}
token: ${{ secrets.github_access_token }}
notify_when: "failure"
notification_title: "Failed to Publish Maven Central Release"
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>"
footer: "Linked Repo <{repo_url}|{repo}> | <{run_url}|View Run>"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
release:
name: Create Github Release
runs-on: ubuntu-latest
steps:
- name: Tune GitHub-hosted runner network
uses: smorimoto/tune-github-hosted-runner-network@v1
- id: release
uses: speakeasy-api/sdk-generation-action@v15
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
action: "release"
speakeasy_api_key: ${{ secrets.speakeasy_api_key }}
speakeasy_server_url: ${{ inputs.speakeasy_server_url }}
- uses: ravsamhq/notify-slack-action@v2
if: always() && env.SLACK_WEBHOOK_URL != ''
with:
status: ${{ job.status }}
token: ${{ secrets.github_access_token }}
notify_when: "failure"
notification_title: "Failed to create Github Release"
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>"
footer: "Linked Repo <{repo_url}|{repo}> | <{run_url}|View Run>"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}