Skip to content

Commit

Permalink
switch ci's to docker
Browse files Browse the repository at this point in the history
  • Loading branch information
molarmanful committed Jan 2, 2025
1 parent 2aba196 commit 12c4d4e
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 26 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/img.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,21 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
distribution: temurin
java-version: 21
- uses: awalsh128/cache-apt-pkgs-action@latest
tags: img
file: img.Dockerfile
push: false
- uses: addnab/docker-run-action@v3
with:
packages: libharfbuzz-bin
version: 1.0
- name: build
run: ./img.sh
image: img
options: -v ${{ github.ref_name }} -n
- uses: shrink/actions-docker-extract@v3
id: extract
with:
image: img
path: /app/.
destination: .
- name: push
uses: stefanzweifel/git-auto-commit-action@v5
24 changes: 16 additions & 8 deletions .github/workflows/pub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ jobs:
with:
persist-credentials: false
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- uses: pnpm/action-setup@v3
with:
version: "*"
Expand All @@ -33,10 +29,22 @@ jobs:
with:
packages: libfuse2t64 bdfresize xfonts-utils woff2
version: 1.0
- name: build
env:
REF: ${{ github.ref_name }}
run: ./build.sh -v "$REF" -n
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
tags: build
file: img.Dockerfile
push: false
- uses: addnab/docker-run-action@v3
with:
image: build
options: -v ${{ github.ref_name }} -n
- uses: shrink/actions-docker-extract@v3
id: extract
with:
image: build
path: /app/out/.
destination: out
- name: release
uses: svenstaro/upload-release-action@2.7.0
with:
Expand Down
13 changes: 13 additions & 0 deletions build.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM greyltc/archlinux-aur:paru AS deps
WORKDIR /app

RUN aur-install fontforge bdfresize xfonts-bdftopcf woff2 zip

ENV JAVA_HOME=/opt/java/openjdk
COPY --from=eclipse-temurin:23-jre $JAVA_HOME $JAVA_HOME
ENV PATH="${JAVA_HOME}/bin:${PATH}"


FROM deps
COPY . .
CMD ["./build.sh"]
13 changes: 3 additions & 10 deletions fns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ bnp_dep() {
fi
}

ff_dep() {
if [ ! -f deps/fontforge ]; then
wget -O deps/fontforge https://github.com/fontforge/fontforge/releases/download/20230101/FontForge-2023-01-01-a1dad3e-x86_64.AppImage
chmod +x deps/fontforge
fi
}

nerd_dep() {
if [ ! -f deps/font-patcher ]; then
wget -O deps/FontPatcher.zip https://github.com/ryanoasis/nerd-fonts/releases/latest/download/FontPatcher.zip
Expand All @@ -32,15 +25,15 @@ ff() {
so0=$(cat scripts/so0.py)
so1=$(cat scripts/so1.py)
fix=$(cat scripts/fix.py)
deps/fontforge -c "$si0$nl$si1$nl$fix$nl$so0" "$PWD"/out/"$1".bdf "$PWD"/out/"$1". "$1"
fontforge -c "$si0$nl$si1$nl$fix$nl$so0" out/"$1".bdf out/"$1". "$1"
}

ttfix() {
nl=$'\n'
si0=$(cat scripts/si0.py)
so1=$(cat scripts/so1.py)
fix=$(cat scripts/fix.py)
deps/fontforge -c "$si0$nl$fix$nl$so1" "$PWD"/out/"$1".ttf
fontforge -c "$si0$nl$fix$nl$so1" out/"$1".ttf
}

pcf() {
Expand All @@ -52,7 +45,7 @@ pcf() {
}

nerd() {
deps/fontforge -script "$PWD"/deps/font-patcher "$PWD"/out/kirsch.ttf -out "$PWD"/out --careful -c "$@"
fontforge -script deps/font-patcher out/kirsch.ttf -out out --careful -c "$@"
}

hb() {
Expand Down
13 changes: 13 additions & 0 deletions img.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM greyltc/archlinux-aur:paru AS deps
WORKDIR /app

RUN aur-install harfbuzz-utils

ENV JAVA_HOME=/opt/java/openjdk
COPY --from=eclipse-temurin:23-jre $JAVA_HOME $JAVA_HOME
ENV PATH="${JAVA_HOME}/bin:${PATH}"


FROM deps
COPY . .
CMD ["./img.sh"]

0 comments on commit 12c4d4e

Please sign in to comment.