-
Notifications
You must be signed in to change notification settings - Fork 3
105 lines (91 loc) · 3.69 KB
/
Copy pathpublish.yml
File metadata and controls
105 lines (91 loc) · 3.69 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Publish Release
env:
# Opt into Node.js 24 ahead of GitHub's 2026-06-02 default switch.
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
on:
push:
tags: ['v*']
workflow_dispatch:
jobs:
# Full CI gate set must pass before publishing. `publish` declares `needs: ci`,
# so a red gate mechanically blocks the publish job — release cannot happen
# without green CI.
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout signalwire-java
uses: actions/checkout@v7
with:
path: signalwire-java
- name: Checkout porting-sdk (mock_relay + mock_signalwire test harnesses + audit scripts)
uses: actions/checkout@v7
with:
repository: signalwire/porting-sdk
# Publish always builds against porting-sdk main — deliberately NOT the
# coordinated-pass PORTING_SDK_REF variable, so a release can never ship from
# an unmerged wave branch (see porting-sdk/COORDINATED_PASS.md).
ref: main
path: porting-sdk
token: ${{ secrets.PORTING_SDK_TOKEN }}
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '21'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6
- name: Set up Python (porting-sdk audit scripts + mock servers)
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Install Python test harnesses (mock_relay + mock_signalwire)
run: |
pip install -e porting-sdk/test_harness/mock_relay
pip install -e porting-sdk/test_harness/mock_signalwire
# ruff is the Python half of the FMT and LINT gates (scripts/ enumerators +
# generators). scripts/_env.sh fails LOUD without it. Config: ./ruff.toml.
- name: Install ruff (Python half of FMT + LINT)
run: |
# PINNED EXACT: an unbounded `pip install ruff` resolves the newest release
# at CI time, so a ruff release that adds a rule or changes a format
# heuristic reds FMT/LINT on a commit that was green locally. Keep in
# lockstep with SW_RUFF_VERSION in scripts/_env.sh.
pip install "ruff==0.15.21"
# Assert the pin took — pip can satisfy a spec from an unexpected
# index or cache, so verify rather than assume.
ruff --version
ruff --version | grep -qw '0\.15\.21' || { echo "FATAL: ruff is not the pinned 0.15.21" >&2; exit 1; }
- name: Run CI gate script (full gate set)
working-directory: signalwire-java
env:
PORTING_SDK: ${{ github.workspace }}/porting-sdk
run: bash scripts/run-ci.sh
publish:
needs: ci
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout signalwire-java
uses: actions/checkout@v7
with:
path: signalwire-java
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '21'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6
- name: Publish to Maven Central
working-directory: signalwire-java
run: ./gradlew publishAndReleaseToMavenCentral
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v3
with:
generate_release_notes: true