Skip to content

Commit 3a93800

Browse files
committed
refactor: update release workflows to include submodule and patches
1 parent b37614f commit 3a93800

9 files changed

Lines changed: 154 additions & 16 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,16 @@ jobs:
1818
- name: Setup go
1919
uses: actions/setup-go@v5
2020
with:
21-
go-version: "^1.23.2"
21+
go-version: "^1.24.0"
22+
23+
- name: Initialize submodules
24+
run: |
25+
git submodule init
26+
git submodule update
27+
28+
- name: Apply patches
29+
run: |
30+
git apply --directory paerser/ patches/nested_maps.diff
2231
2332
- name: Install frontend dependencies
2433
run: |

.github/workflows/nightly.yml

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,16 @@ jobs:
6161
- name: Install go
6262
uses: actions/setup-go@v5
6363
with:
64-
go-version: "^1.23.2"
64+
go-version: "^1.24.0"
65+
66+
- name: Initialize submodules
67+
run: |
68+
git submodule init
69+
git submodule update
70+
71+
- name: Apply patches
72+
run: |
73+
git apply --directory paerser/ patches/nested_maps.diff
6574
6675
- name: Install frontend dependencies
6776
run: |
@@ -107,7 +116,16 @@ jobs:
107116
- name: Install go
108117
uses: actions/setup-go@v5
109118
with:
110-
go-version: "^1.23.2"
119+
go-version: "^1.24.0"
120+
121+
- name: Initialize submodules
122+
run: |
123+
git submodule init
124+
git submodule update
125+
126+
- name: Apply patches
127+
run: |
128+
git apply --directory paerser/ patches/nested_maps.diff
111129
112130
- name: Install frontend dependencies
113131
run: |
@@ -147,6 +165,15 @@ jobs:
147165
with:
148166
ref: nightly
149167

168+
- name: Initialize submodules
169+
run: |
170+
git submodule init
171+
git submodule update
172+
173+
- name: Apply patches
174+
run: |
175+
git apply --directory paerser/ patches/nested_maps.diff
176+
150177
- name: Docker meta
151178
id: meta
152179
uses: docker/metadata-action@v5
@@ -205,6 +232,15 @@ jobs:
205232
with:
206233
ref: nightly
207234

235+
- name: Initialize submodules
236+
run: |
237+
git submodule init
238+
git submodule update
239+
240+
- name: Apply patches
241+
run: |
242+
git apply --directory paerser/ patches/nested_maps.diff
243+
208244
- name: Docker meta
209245
id: meta
210246
uses: docker/metadata-action@v5
@@ -263,6 +299,15 @@ jobs:
263299
with:
264300
ref: nightly
265301

302+
- name: Initialize submodules
303+
run: |
304+
git submodule init
305+
git submodule update
306+
307+
- name: Apply patches
308+
run: |
309+
git apply --directory paerser/ patches/nested_maps.diff
310+
266311
- name: Docker meta
267312
id: meta
268313
uses: docker/metadata-action@v5
@@ -321,6 +366,15 @@ jobs:
321366
with:
322367
ref: nightly
323368

369+
- name: Initialize submodules
370+
run: |
371+
git submodule init
372+
git submodule update
373+
374+
- name: Apply patches
375+
run: |
376+
git apply --directory paerser/ patches/nested_maps.diff
377+
324378
- name: Docker meta
325379
id: meta
326380
uses: docker/metadata-action@v5

.github/workflows/release.yml

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,16 @@ jobs:
3939
- name: Install go
4040
uses: actions/setup-go@v5
4141
with:
42-
go-version: "^1.23.2"
42+
go-version: "^1.24.0"
43+
44+
- name: Initialize submodules
45+
run: |
46+
git submodule init
47+
git submodule update
48+
49+
- name: Apply patches
50+
run: |
51+
git apply --directory paerser/ patches/nested_maps.diff
4352
4453
- name: Install frontend dependencies
4554
run: |
@@ -82,7 +91,16 @@ jobs:
8291
- name: Install go
8392
uses: actions/setup-go@v5
8493
with:
85-
go-version: "^1.23.2"
94+
go-version: "^1.24.0"
95+
96+
- name: Initialize submodules
97+
run: |
98+
git submodule init
99+
git submodule update
100+
101+
- name: Apply patches
102+
run: |
103+
git apply --directory paerser/ patches/nested_maps.diff
86104
87105
- name: Install frontend dependencies
88106
run: |
@@ -119,6 +137,15 @@ jobs:
119137
- name: Checkout
120138
uses: actions/checkout@v4
121139

140+
- name: Initialize submodules
141+
run: |
142+
git submodule init
143+
git submodule update
144+
145+
- name: Apply patches
146+
run: |
147+
git apply --directory paerser/ patches/nested_maps.diff
148+
122149
- name: Docker meta
123150
id: meta
124151
uses: docker/metadata-action@v5
@@ -174,6 +201,15 @@ jobs:
174201
- name: Checkout
175202
uses: actions/checkout@v4
176203

204+
- name: Initialize submodules
205+
run: |
206+
git submodule init
207+
git submodule update
208+
209+
- name: Apply patches
210+
run: |
211+
git apply --directory paerser/ patches/nested_maps.diff
212+
177213
- name: Docker meta
178214
id: meta
179215
uses: docker/metadata-action@v5
@@ -229,6 +265,15 @@ jobs:
229265
- name: Checkout
230266
uses: actions/checkout@v4
231267

268+
- name: Initialize submodules
269+
run: |
270+
git submodule init
271+
git submodule update
272+
273+
- name: Apply patches
274+
run: |
275+
git apply --directory paerser/ patches/nested_maps.diff
276+
232277
- name: Docker meta
233278
id: meta
234279
uses: docker/metadata-action@v5
@@ -284,6 +329,15 @@ jobs:
284329
- name: Checkout
285330
uses: actions/checkout@v4
286331

332+
- name: Initialize submodules
333+
run: |
334+
git submodule init
335+
git submodule update
336+
337+
- name: Apply patches
338+
run: |
339+
git apply --directory paerser/ patches/nested_maps.diff
340+
287341
- name: Docker meta
288342
id: meta
289343
uses: docker/metadata-action@v5

.gitmodules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[submodule "paerser"]
22
path = paerser
33
url = https://github.com/traefik/paerser
4+
ignore = all

CONTRIBUTING.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Contributing is relatively easy, you just need to follow the steps below and you
55
## Requirements
66

77
- Bun
8-
- Golang v1.23.2 and above
8+
- Golang v1.24.0+
99
- Git
1010
- Docker
1111

@@ -18,12 +18,21 @@ git clone https://github.com/steveiliop56/tinyauth
1818
cd tinyauth
1919
```
2020

21+
## Initialize submodules
22+
23+
The project uses Git submodules for some dependencies, so you need to initialize them with:
24+
25+
```sh
26+
git submodule init
27+
git submodule update
28+
```
29+
2130
## Install requirements
2231

23-
Although you will not need the requirements in your machine since the development will happen in docker, I still recommend to install them because this way you will not have import errors. To install the go requirements run:
32+
Although you will not need the requirements in your machine since the development will happen in Docker, I still recommend to install them because this way you will not have import errors. To install the Go requirements run:
2433

2534
```sh
26-
go mod tidy
35+
go mod download
2736
```
2837

2938
You also need to download the frontend dependencies, this can be done like so:
@@ -33,13 +42,21 @@ cd frontend/
3342
bun install
3443
```
3544

45+
## Apply patches
46+
47+
Some of the dependencies need to be patched in order to work correctly with the project, you can apply the patches by running:
48+
49+
```sh
50+
git apply --directory paerser/ patches/nested_maps.diff
51+
```
52+
3653
## Create your `.env` file
3754

3855
In order to configure the app you need to create an environment file, this can be done by copying the `.env.example` file to `.env` and modifying the environment variables to suit your needs.
3956

4057
## Developing
4158

42-
I have designed the development workflow to be entirely in docker, this is because it will directly work with traefik and you will not need to do any building in your host machine. The recommended development setup is to have a subdomain pointing to your machine like this:
59+
I have designed the development workflow to be entirely in Docker, this is because it will directly work with Traefik and you will not need to do any building in your host machine. The recommended development setup is to have a subdomain pointing to your machine like this:
4360

4461
```
4562
*.dev.example.com -> 127.0.0.1
@@ -49,7 +66,7 @@ dev.example.com -> 127.0.0.1
4966
> [!TIP]
5067
> You can use [sslip.io](https://sslip.io) as a domain if you don't have one to develop with.
5168
52-
Then you can just make sure the domains are correct in the development docker compose file and run:
69+
Then you can just make sure the domains are correct in the development Docker compose file and run:
5370

5471
```sh
5572
docker compose -f docker-compose.dev.yml up --build

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ ARG BUILD_TIMESTAMP
2828

2929
WORKDIR /tinyauth
3030

31+
COPY ./paerser ./paerser
32+
3133
COPY go.mod ./
3234
COPY go.sum ./
3335

@@ -38,7 +40,7 @@ COPY ./internal ./internal
3840
COPY --from=frontend-builder /frontend/dist ./internal/assets/dist
3941

4042
RUN CGO_ENABLED=0 go build -ldflags "-s -w -X tinyauth/internal/config.Version=${VERSION} -X tinyauth/internal/config.CommitHash=${COMMIT_HASH} -X tinyauth/internal/config.BuildTimestamp=${BUILD_TIMESTAMP}" ./cmd/tinyauth
41-
43+
4244
# Runner
4345
FROM alpine:3.23 AS runner
4446

@@ -62,4 +64,4 @@ ENV PATH=$PATH:/tinyauth
6264

6365
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 CMD ["tinyauth", "healthcheck"]
6466

65-
ENTRYPOINT ["tinyauth"]
67+
ENTRYPOINT ["tinyauth"]

Dockerfile.distroless

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ ARG BUILD_TIMESTAMP
2828

2929
WORKDIR /tinyauth
3030

31+
COPY ./paerser ./paerser
32+
3133
COPY go.mod ./
3234
COPY go.sum ./
3335

@@ -40,7 +42,7 @@ COPY --from=frontend-builder /frontend/dist ./internal/assets/dist
4042
RUN mkdir -p data
4143

4244
RUN CGO_ENABLED=0 go build -ldflags "-s -w -X tinyauth/internal/config.Version=${VERSION} -X tinyauth/internal/config.CommitHash=${COMMIT_HASH} -X tinyauth/internal/config.BuildTimestamp=${BUILD_TIMESTAMP}" ./cmd/tinyauth
43-
45+
4446
# Runner
4547
FROM gcr.io/distroless/static-debian12:latest AS runner
4648

@@ -65,4 +67,4 @@ ENV PATH=$PATH:/tinyauth
6567

6668
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 CMD ["tinyauth", "healthcheck"]
6769

68-
ENTRYPOINT ["tinyauth"]
70+
ENTRYPOINT ["tinyauth"]

docker-compose.dev.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ services:
4242
volumes:
4343
- ./internal:/tinyauth/internal
4444
- ./cmd:/tinyauth/cmd
45-
- ./main.go:/tinyauth/main.go
4645
- /var/run/docker.sock:/var/run/docker.sock
4746
- ./data:/data
4847
ports:

paerser

0 commit comments

Comments
 (0)