-
Notifications
You must be signed in to change notification settings - Fork 1
142 lines (125 loc) · 6.34 KB
/
main-build.yml
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
name: main
on:
push:
branches: ["main"]
paths-ignore:
- docs/*
permissions:
contents: read
packages: write
jobs:
prepare:
if: "!contains(github.event.head_commit.message, '[skip-ci]')"
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Read versions from file(s)
id: read-versions
shell: bash
run: |
echo "spicedb-version=$(cat src/spicedb.version)" >> ${GITHUB_ENV}
echo "spicedb-version=$(cat src/spicedb.version)" >> ${GITHUB_OUTPUT}
echo "openapi-version=$(cat src/openapi.version)" >> ${GITHUB_OUTPUT}
- name: Create SpiceDB OpenAPI spec url
id: spicedb-openapi-url
shell: bash
# TODO use official spec again
# run: echo "url=https://raw.githubusercontent.com/authzed/authzed-go/refs/tags/${{ env.spicedb-version }}/proto/apidocs.swagger.json" >> ${GITHUB_OUTPUT}
#run: echo "url=https://raw.githubusercontent.com/holgerstolzenberg/authzed-go/refs/heads/feature/openapi-global-security-definition/proto/apidocs.swagger.json" >> ${GITHUB_OUTPUT}
run: echo "url=https://raw.githubusercontent.com/authzed/authzed-go/refs/heads/openapi-authentication-bearer/proto/apidocs.swagger.json" >> ${GITHUB_OUTPUT}
- name: Get next semver version
uses: reecetech/version-increment@2024.10.1
id: next-artifact-version
with:
scheme: semver
increment: patch
outputs:
spicedb-version: ${{ steps.read-versions.outputs.spicedb-version }}
openapi-version: ${{ steps.read-versions.outputs.openapi-version }}
spicedb-openapi-url: ${{ steps.spicedb-openapi-url.outputs.url }}
next-artifact-version: ${{ steps.next-artifact-version.outputs.version }}
java-client:
if: "!contains(github.event.head_commit.message, '[skip-ci]')"
needs: [prepare]
runs-on: ubuntu-22.04
strategy:
matrix:
java-version: [17, 21]
java-http-lib: [feign, resttemplate, webclient, restclient, okhttp-gson]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags
- name: Create target Java artifact version
shell: bash
run: echo "JAVA_ARTIFACT_VERSION=${{ needs.prepare.outputs.next-artifact-version }}-${{ matrix.java-version }}-${{ needs.prepare.outputs.spicedb-version }}" >> ${GITHUB_ENV}
- name: "Run java client build / SpiceDB: ${{ env.SPICEDB_VERSION }} / Java: ${{ matrix.java-version}} / HTTP lib: ${{ matrix.java-http-lib }}"
uses: ./.github/actions/java-client
with:
spicedb-version: ${{ needs.prepare.outputs.spicedb-version }}
release-version: ${{ env.JAVA_ARTIFACT_VERSION }}
snapshot: true
openapi-spec: ${{ needs.prepare.outputs.spicedb-openapi-url }}
openapi-version: ${{ needs.prepare.outputs.openapi-version }}
- name: "Publish java client snapshot to GitHub packages / SpiceDB: ${{ env.SPICEDB_VERSION }} / Java: ${{ matrix.java-version }} / HTTP lib: ${{ matrix.java-http-lib }}"
uses: ./.github/actions/java-client-publish-snapshot
with:
gh-token: ${{ secrets.GITHUB_TOKEN }}
typescript-client:
if: "!contains(github.event.head_commit.message, '[skip-ci]')"
needs: [prepare]
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [21]
generator: [typescript, typescript-axios, typescript-fetch, typescript-angular]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags
- name: Create target NPM artifact version
shell: bash
run: echo "NPM_ARTIFACT_VERSION=${{ needs.prepare.outputs.next-artifact-version }}-${{ matrix.node-version }}-${{ needs.prepare.outputs.spicedb-version }}" >> ${GITHUB_ENV}
- name: "Run typescript client build / SpiceDB: ${{ env.SPICEDB_VERSION }} / Node: ${{ matrix.node-version }} / Generator: ${{ matrix.generator }}"
uses: ./.github/actions/typescript-client
with:
spicedb-version: ${{ needs.prepare.outputs.spicedb-version }}
release-version: ${{ env.NPM_ARTIFACT_VERSION }}
generator: ${{ matrix.generator }}
gh-token: ${{ secrets.GITHUB_TOKEN }}
openapi-spec: ${{ needs.prepare.outputs.spicedb-openapi-url }}
openapi-version: ${{ needs.prepare.outputs.openapi-version }}
snapshot: true
- name: "Publish NPM client snapshot to GitHub packages / SpiceDB: ${{ env.SPICEDB_VERSION }} / Node: ${{ matrix.java-version }} / Generator: ${{ matrix.java-http-lib }}"
uses: ./.github/actions/typescript-client-publish-snapshot
with:
gh-token: ${{ secrets.GITHUB_TOKEN }}
generator: ${{ matrix.generator }}
python-client:
if: "!contains(github.event.head_commit.message, '[skip-ci]')"
needs: [prepare]
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [3.13]
python-http-lib: [urllib3]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags
- name: Create target Python artifact version
shell: bash
# TODO what is the proper snapshot version here -> 'dev'?
#run: echo "PYTHON_ARTIFACT_VERSION=${{ needs.prepare.outputs.next-artifact-version }}-${{ matrix.python-version }}-${{ needs.prepare.outputs.spicedb-version }}.dev" >> ${GITHUB_ENV}
run: echo "PYTHON_ARTIFACT_VERSION=${{ needs.prepare.outputs.next-artifact-version }}.dev" >> ${GITHUB_ENV}
- name: "Run python client build / SpiceDB: ${{ env.SPICEDB_VERSION }} / Python: ${{ matrix.python-version}} / HTTP lib: ${{ matrix.python-http-lib }}"
uses: ./.github/actions/python-client
with:
spicedb-version: ${{ needs.prepare.outputs.spicedb-version }}
release-version: ${{ env.PYTHON_ARTIFACT_VERSION }}
openapi-spec: ${{ needs.prepare.outputs.spicedb-openapi-url }}
openapi-version: ${{ needs.prepare.outputs.openapi-version }}