Skip to content

Commit 9cbfb24

Browse files
build: getting the frontend build pipeline working with pnpm (#94)
* build: getting the frontend build pipeline working with pnpm * chore: update Dockerfile and GitHub actions * doc: add Jessica Sachs to contributor list A BIG THANK YOU! --------- Co-authored-by: nanmu42 <[email protected]>
1 parent 5d8faad commit 9cbfb24

File tree

11 files changed

+10919
-9182
lines changed

11 files changed

+10919
-9182
lines changed

Diff for: .github/workflows/build.yml

+11-6
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,25 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- name: Check out code
10-
uses: actions/checkout@v3
10+
uses: actions/checkout@v4
1111

1212
- name: Set up Node
13-
uses: actions/setup-node@v3
13+
uses: actions/setup-node@v4
1414
with:
15-
node-version: 16.15.1
15+
node-version: 20.13.1
16+
17+
- name: Set up PNPM
18+
uses: pnpm/action-setup@v4
19+
with:
20+
version: 9
1621

1722
- name: Build Frontend
1823
run: make frontend
1924

2025
- name: Set up Go
21-
uses: actions/setup-go@v4
26+
uses: actions/setup-go@v5
2227
with:
23-
go-version: 1.x
28+
go-version: stable
2429

2530
- name: Get dependencies
2631
run: go get ./...
@@ -29,6 +34,6 @@ jobs:
2934
run: make rly
3035

3136
- name: golangci-lint
32-
uses: golangci/golangci-lint-action@v3
37+
uses: golangci/golangci-lint-action@v6
3338
with:
3439
version: latest

Diff for: .github/workflows/docker.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1414
- name: Build, tag, and push
1515
env:
1616
DOCKER_HUB_REPO: nanmu42/orly

Diff for: Dockerfile

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
FROM golang:alpine3.17 as golang
2-
RUN apk --no-cache add make git tar tzdata ca-certificates nodejs=16.15.1 yarn wget
1+
FROM golang:alpine3.20 as golang
2+
RUN apk --no-cache add make git tar tzdata ca-certificates nodejs=20.13.1-r0 wget xz
3+
RUN wget -qO /bin/pnpm "https://github.com/pnpm/pnpm/releases/latest/download/pnpm-linuxstatic-x64" && chmod +x /bin/pnpm
4+
35
WORKDIR /app
46
COPY . .
5-
RUN mkdir -p assets && \
6-
cd assets && \
7-
wget -nc https://github.com/nanmu42/orly/releases/download/1.5.0-beta/cover-images.tar.xz && \
8-
wget -nc https://github.com/nanmu42/orly/releases/download/1.1.0-beta/fonts.tar.xz
7+
RUN make assets
98
RUN make all
109

11-
FROM alpine:3.17
10+
FROM alpine3.20
1211
# Maintainer Info
1312
LABEL maintainer="nanmu42<[email protected]>"
1413
# Dependencies

Diff for: Makefile

+10-4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ dir:
1111
mkdir -p bin/fonts && \
1212
mkdir -p bin/cover-images
1313

14+
assets:
15+
mkdir -p assets && \
16+
cd assets && \
17+
wget -nc https://github.com/nanmu42/orly/releases/download/1.5.0-beta/cover-images.tar.xz && \
18+
wget -nc https://github.com/nanmu42/orly/releases/download/1.1.0-beta/fonts.tar.xz
19+
1420
clean:
1521
rm -rf bin
1622

@@ -21,20 +27,20 @@ config: dir
2127

2228
frontend: dir
2329
cd frontend && \
24-
yarn install && yarn build && \
30+
pnpm install && pnpm build && \
2531
cp -r dist/* $(PWD)/bin/web
2632

2733
rly: rly.bin
2834

29-
fonts: dir
35+
fonts: dir assets
3036
cd assets && \
3137
tar -xf fonts.tar.xz --skip-old-files -C $(PWD)/bin/fonts
3238

33-
covers: dir
39+
covers: dir assets
3440
cd assets && \
3541
tar -xf cover-images.tar.xz --skip-old-files -C $(PWD)/bin/cover-images
3642

3743
%.bin: dir
3844
cd cmd/$* && \
3945
CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -X main.Version=$(VERSION) -X main.BuildDate=$(BUILD)" && \
40-
cp $* $(PWD)/bin/$*
46+
cp $* $(PWD)/bin/$*

Diff for: README.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,7 @@ Save as `rly.toml`, mount it into `/app/config`, and run docker image with param
5151
O'RLY can be built in following commands:
5252

5353
```bash
54-
mkdir -p assets
55-
cd assets
56-
wget -nc https://github.com/nanmu42/orly/releases/download/1.5.0-beta/cover-images.tar.xz
57-
wget -nc https://github.com/nanmu42/orly/releases/download/1.1.0-beta/fonts.tar.xz
58-
cd ..
54+
make assets
5955
make all
6056
```
6157

@@ -91,6 +87,7 @@ Many thanks :hugs: to following contributors:
9187
* [TahsinGokalp](https://github.com/TahsinGokalp) (Turkish translation)
9288
* [wooogi123](https://github.com/wooogi123) (Korean translation)
9389
* [cauldnz](https://github.com/cauldnz) (Adding new animal)
90+
* [Jessica Sachs](https://github.com/JessicaSachs) (Project maintainer!)
9491

9592
# Projects in Brotherhood
9693

Diff for: README_ZH.md

+1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ O'RLY 是一个简易的API服务和静态前端的组合:
9090
* [TahsinGokalp](https://github.com/TahsinGokalp) (土耳其语翻译)
9191
* [wooogi123](https://github.com/wooogi123) (韩语翻译)
9292
* [cauldnz](https://github.com/cauldnz) (新增动物)
93+
* [Jessica Sachs](https://github.com/JessicaSachs) (项目维护者!)
9394

9495
# 兄弟项目
9596

Diff for: frontend/.npmrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node-options=--openssl-legacy-provider
2+
node-linker=hoisted

0 commit comments

Comments
 (0)