-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (124 loc) · 3.84 KB
/
Copy pathci.yml
File metadata and controls
148 lines (124 loc) · 3.84 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: "⚙️ CI & Release Workflow"
on:
push:
pull_request:
types: [ opened, reopened ]
env:
JAVA_VERSION: '25'
JAVA_DISTRIBUTION: 'temurin'
permissions:
contents: write
jobs:
generate:
name: "🧬 Generate proto"
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: "📥 Checkout Code (Full History)"
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: "📦 Setup Buf"
uses: bufbuild/buf-setup-action@v1.50.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: "🧬 Generate Protobuf Files"
run: make generate-proto
- name: Auto-commit and push changes
uses: stefanzweifel/git-auto-commit-action@v7
with:
commit_message: "🤖 Generate protobufs"
file_pattern: "sdk/**/*"
lint:
name: "🧹 Lint Code"
runs-on: ubuntu-latest
needs: generate
permissions:
contents: read
steps:
- name: "📥 Checkout Code"
uses: actions/checkout@v7
- name: "📦 Setup Buf"
uses: bufbuild/buf-setup-action@v1.50.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: "🧬 Generate Protobuf Files"
run: make generate-proto
- name: "🔧 Setup Go"
uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- name: "🔍 Run golangci-lint"
uses: golangci/golangci-lint-action@v9
with:
version: latest
args: --timeout 3m0s
releaser:
name: "🏁 Release"
if: startsWith(github.ref, 'refs/tags/')
needs:
- lint
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: "📥 Checkout Code (Full History)"
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: "📦 Setup Buf"
uses: bufbuild/buf-setup-action@v1.50.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: "🧬 Generate Protobuf Files"
run: make generate-proto
- name: "🔧 Setup Go (with Cache)"
uses: actions/setup-go@v6
with:
cache: true
go-version-file: go.mod
cache-dependency-path: go.sum
- name: ☕ Setup Java ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v5
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
- name: "🔧 Setup Node"
uses: actions/setup-node@v6
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
- name: "Extract version from tag"
id: version
run: |
RAW_TAG="${GITHUB_REF##*/}"
VERSION="${RAW_TAG#v}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: "Set npm version from tag"
working-directory: sdk/ts
run: |
npm version ${{ steps.version.outputs.version }} --no-git-tag-version
- run: npm ci
working-directory: sdk/ts
- run: npm publish --dry-run
working-directory: sdk/ts
- name: "🚀 Publish to npm"
working-directory: sdk/ts
run: |
npm publish --access public
- name: ⚡ Setup Gradle with Cache
uses: gradle/actions/setup-gradle@v6
- name: "🚀 Publish to Maven Central"
env:
GPG_KEY: ${{ secrets.GPG_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
run: |
RAW_TAG="${GITHUB_REF##*/}"
VERSION="${RAW_TAG#v}"
[[ "$VERSION" =~ ^[0-9]+(\.[0-9]+)*$ ]] || exit -1
./gradlew publishToCentralPortal -Pversion="$VERSION" --info --stacktrace