Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
### Enable BuildKit features (e.g. secrets mounts)
# syntax=docker/dockerfile:1.5
FROM --platform=$BUILDPLATFORM kglovernsienci/gsender-pi-builder AS builder
ARG BUILDPLATFORM
ARG NODE_OPTIONS="--max-old-space-size=8192"
ARG USE_SYSTEM_FPM="true"
ARG GITHUB_REF_NAME
ARG GITHUB_REF_TYPE
ARG GIT_COMMIT_LOG
WORKDIR /app
COPY . .
RUN npm install -g bun
RUN npm install --legacy-peer-deps
RUN npm run package-sync
RUN npm install --prefix src --production --ignore-scripts --legacy-peer-deps
RUN if [ "$GITHUB_REF_TYPE" = "tag" ]; then npm run prebuild-prod; else npm run prebuild-latest; fi
RUN if [ "$GITHUB_REF_TYPE" = "tag" ]; then npm run build; else npm run build-latest; fi
RUN --mount=type=secret,id=GH_TOKEN \
export GH_TOKEN="$(cat /run/secrets/GH_TOKEN)" && \
export GITHUB_TOKEN="$GH_TOKEN" && \
npm run build:linux-arm64
# rename package to PI-64Bit
RUN for f in /app/output/*.deb; do mv "$f" "$(echo "$f" | sed s/arm64/PI-64Bit/)"; done
RUN for f in /app/output/*.AppImage; do mv "$f" "$(echo "$f" | sed s/arm64/PI-64Bit/)"; done
# copy to release
RUN mkdir -p release/pi/
RUN for f in /app/output/*.deb; do cp -af "$f" "$(echo "$f" | sed s/output/release\\/pi/)"; done
RUN for f in /app/output/*.AppImage; do cp -af "$f" "$(echo "$f" | sed s/output/release\\/pi/)"; done
RUN --mount=type=secret,id=GH_TOKEN \
export GH_TOKEN="$(cat /run/secrets/GH_TOKEN)" && \
export GITHUB_TOKEN="$GH_TOKEN" && \
if [[ "$GITHUB_REF_TYPE" == "branch" && "$GITHUB_REF_NAME" == "master" ]]; then \
./node_modules/.bin/github-release delete \
--owner=gSender \
--repo=gsender \
--tag="${GITHUB_REF_NAME}-latest" \
--release-name="${GITHUB_REF_NAME}" \
"*-pi*"; \
./node_modules/.bin/github-release upload \
--owner=gSender \
--repo=gsender \
--tag="${GITHUB_REF_NAME}-latest" \
--release-name="${GITHUB_REF_NAME}" \
--body="${GIT_COMMIT_LOG}" \
releases/pi/*; \
fi
FROM scratch AS artifact
COPY --from=builder /app/output/*.deb .
COPY --from=builder /app/output/*.AppImage .
6bc89d73dThis file is pinned to the selected release. Download the original to open it in your design tool.