Skip to content

Commit 86a17f2

Browse files
committed
github actions
1 parent ecb856a commit 86a17f2

File tree

4 files changed

+85
-0
lines changed

4 files changed

+85
-0
lines changed

.dockerignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Dockerfile.android
2+
app.apk
3+
.direnv/
4+
.github/
5+
.secrets
6+
app.tar.xz
7+
flake.nix
8+
flake.lock

.github/workflows/build.yaml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
- name: Create artifact directory
24+
run: mkdir -p artifacts
25+
26+
- name: Copy artifacts from container
27+
run: docker create build:latest --name extract && docker cp extract:/out/ ./
28+
29+
- name: Upload build artifacts
30+
uses: actions/upload-artifact@v3
31+
with:
32+
name: output
33+
path: out/

Dockerfile

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
13+
COPY go.mod go.sum main.go Icon.png .
14+
COPY helper ./helper
15+
COPY pages ./pages
16+
COPY preferences ./preferences
17+
COPY resources ./resources
18+
COPY state ./state
19+
20+
RUN fyne package --target android -appID io.bbfs.app -icon Icon.png --release
21+
22+
23+
24+
FROM golang:alpine AS builder-linux
25+
WORKDIR /build
26+
27+
RUN apk add go gcc libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev linux-headers mesa-dev xz
28+
RUN go install fyne.io/fyne/v2/cmd/fyne@latest
29+
30+
COPY go.mod go.sum main.go Icon.png .
31+
COPY helper ./helper
32+
COPY pages ./pages
33+
COPY preferences ./preferences
34+
COPY resources ./resources
35+
COPY state ./state
36+
37+
RUN fyne package --target linux -appID io.bbfs.app -icon Icon.png --release && mv app.tar.xz app_linux.tar.xz
38+
39+
40+
FROM scratch
41+
WORKDIR /out
42+
COPY --from=builder-android /build/app.apk .
43+
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)