Skip to content

Commit f56ffe8

Browse files
committed
github actions
1 parent ecb856a commit f56ffe8

File tree

4 files changed

+67
-0
lines changed

4 files changed

+67
-0
lines changed

.dockerignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Dockerfile.android
2+
app.apk
3+
.direnv/
4+
flake.nix
5+
flake.lock

.github/workflows/build.yaml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Build Android Docker Image and Upload Artifacts
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v3
15+
16+
- name: Set up Depot CLI
17+
uses: depot/setup-action@v1
18+
19+
- run: depot build --project 0k8767spqx --load --tag build -f Dockerfile .
20+
env:
21+
DEPOT_TOKEN: ${{ secrets.DEPOT_TOKEN }}
22+
23+
- uses: shrink/actions-docker-extract@v3
24+
with:
25+
image: "build:latest"
26+
path: "/out/"
27+
28+
- name: Upload build artifacts
29+
uses: actions/upload-artifact@v3
30+
with:
31+
name: android-build-output
32+
path: out/

Dockerfile

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM golang:bookworm AS builder-android
2+
WORKDIR /build
3+
4+
RUN apt update
5+
RUN apt-get install curl unzip -y
6+
7+
RUN curl -LO https://dl.google.com/android/repository/android-ndk-r27b-linux.zip && unzip android-ndk-r27b-linux.zip
8+
ENV ANDROID_NDK_HOME=/build/android-ndk-r27b/
9+
10+
RUN apt-get install golang gcc gcc-mingw-w64 -y
11+
RUN go install fyne.io/fyne/v2/cmd/fyne@latest
12+
COPY . .
13+
RUN fyne package --target android -appID io.bbfs.app -icon Icon.png --release
14+
15+
16+
17+
FROM golang:alpine AS builder-linux
18+
WORKDIR /build
19+
20+
RUN apk add go gcc libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev linux-headers mesa-dev xz
21+
RUN go install fyne.io/fyne/v2/cmd/fyne@latest
22+
COPY . .
23+
RUN fyne package --target linux -appID io.bbfs.app -icon Icon.png --release && mv app.tar.xz app_linux.tar.xz
24+
25+
26+
FROM scratch
27+
WORKDIR /out
28+
COPY --from=builder-android /build/app.apk .
29+
COPY --from=builder-linux /build/app_linux.tar.xz .

depot.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"id":"0k8767spqx"}

0 commit comments

Comments
 (0)