Compare commits

...

18 Commits
v0.1.1 ... main

Author SHA1 Message Date
db854cda24
feat: build-tools 34
Some checks failed
/ build (push) Failing after 56m29s
2025-02-20 14:29:14 +00:00
d306898272
feat(action): pull image instead of rebuild
All checks were successful
/ build (push) Successful in 8m50s
2025-02-02 01:19:23 +00:00
3b8d5f8a10
fix: kaniko forbidden syntax
All checks were successful
/ build (push) Successful in 8m6s
2025-02-01 23:37:39 +00:00
891d82d6d4
fix: remove WORKDIR necessities
Some checks failed
/ build (push) Failing after 2m35s
2025-02-01 23:33:39 +00:00
05f017a190
feat: gitea action
Some checks failed
/ build (push) Failing after 7m3s
2025-02-01 17:12:54 +00:00
664c1c9cee
fix: add android-33 to avoid redownloading
All checks were successful
/ build (push) Successful in 7m50s
2025-02-01 16:19:48 +00:00
7ad445b609
feat: default build command 2025-02-01 15:46:09 +00:00
fc9c206d38
feat: precache gradle
All checks were successful
/ build (push) Successful in 8m40s
2025-01-27 15:17:45 +00:00
7cb18de6d7
feat: README 2025-01-27 04:50:29 +00:00
84b527a60a
fix: versioning
Some checks failed
/ build (push) Failing after 4h28m6s
2025-01-27 03:12:11 +00:00
d25876537c
fix: gradle redownloading 2 sdk prior
All checks were successful
/ build (push) Successful in 6m47s
2025-01-26 08:24:47 +00:00
76d32f621e
feat: image precaches all packages
Some checks failed
/ build (push) Failing after 47h15m10s
2025-01-24 05:56:04 +00:00
59aaea4a9c
bump: 3.27.3
All checks were successful
/ build (push) Successful in 6m21s
2025-01-24 05:42:53 +00:00
ce6e30dd9d
bump: flutter 3.27.0
All checks were successful
/ build (push) Successful in 6m1s
2024-12-17 02:22:43 +00:00
9cc7d205e9
fix: simplify copy --chown
All checks were successful
/ build (push) Successful in 5m28s
2024-12-16 12:58:38 +00:00
ce7e192461
Trigger build
Some checks failed
/ build (push) Failing after 4m56s
2024-11-16 12:00:48 +08:00
f66243ba57
bump: flutter 3.24.5
Some checks failed
/ build (push) Failing after 4m56s
2024-11-14 18:48:46 +08:00
c5ceb5d186
fix: remove too complex rootless logic 2024-11-14 18:42:58 +08:00
4 changed files with 63 additions and 11 deletions

View File

@ -1,19 +1,31 @@
FROM docker.io/debian:12-slim as build FROM docker.io/debian:12-slim AS build
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y --no-install-recommends \ && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
sdkmanager \ sdkmanager \
xz-utils \ xz-utils \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
ADD https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.24.4-stable.tar.xz /flutter.tar.xz # https://docs.flutter.dev/release/archive
RUN tar -C /opt/ --exclude=cache -xJf /flutter.tar.xz RUN curl https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.27.3-stable.tar.xz \
| tar --no-same-owner -C /opt/ -xJ
# https://developer.android.com/tools/releases/build-tools
RUN sdkmanager \ RUN sdkmanager \
"build-tools;35.0.0" \ "build-tools;33.0.1" \
"build-tools;34.0.0" \
"cmdline-tools;9.0" \ "cmdline-tools;9.0" \
"platform-tools;35.0.2" \ "platform-tools" \
"platforms;android-33" \
"platforms;android-34" \
"platforms;android-35" "platforms;android-35"
# https://gradle.org/releases/
RUN curl -Lo /gradle.zip \
'https://services.gradle.org/distributions/gradle-8.12.1-bin.zip'
FROM docker.io/debian:12-slim FROM docker.io/debian:12-slim
RUN useradd -m app ENV DEBIAN_FRONTEND=noninteractive
RUN touch /.dockerenv
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y --no-install-recommends \ && apt-get install -y --no-install-recommends \
curl \ curl \
@ -21,10 +33,14 @@ RUN apt-get update \
openjdk-17-jdk-headless \ openjdk-17-jdk-headless \
unzip \ unzip \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
COPY --from=build --chown=app:app /opt/ /opt/ COPY --from=build /opt/ /opt/
USER app ENV GRADLE_ZIP=/gradle.zip
COPY --from=build /gradle.zip "$GRADLE_ZIP"
ENV PATH="/opt/flutter/bin:$PATH" ENV PATH="/opt/flutter/bin:$PATH"
RUN flutter config --android-sdk /opt/android-sdk/ \ RUN flutter config --android-sdk /opt/android-sdk/
&& yes | flutter doctor --android-licenses > /dev/null RUN flutter precache --android
RUN yes | flutter doctor --android-licenses
COPY entrypoint.sh /usr/local/bin/
WORKDIR /app/ WORKDIR /app/
ENTRYPOINT ["flutter"] ENTRYPOINT ["entrypoint.sh"]
CMD ["build", "apk"]

21
README.md Normal file
View File

@ -0,0 +1,21 @@
# docker-flutter
## Action
```yaml
- uses: icing/flutter@main
```
## Docker image
### Examples
- Run
```bash
docker volume create --ignore fluttercache
docker run --rm --network host -v "$PWD:/app/" -v "fluttercache:/home/gradle/.gradle/" git.gmoker.com/icing/flutter:main run
```
- Build
```bash
docker volume create --ignore fluttercache
docker run --rm -v "$PWD:/app/" -v "fluttercache:/home/gradle/.gradle/" git.gmoker.com/icing/flutter:main build apk
```
The apk will be found at `build/app/outputs/flutter-apk/app-release.apk`.

3
action.yml Normal file
View File

@ -0,0 +1,3 @@
runs:
using: docker
image: git.gmoker.com/icing/flutter:main

12
entrypoint.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
PROPS=android/gradle/wrapper/gradle-wrapper.properties
BAK=/bak
cp "$PROPS" "$BAK" || exit 1
# shellcheck disable=SC2064
trap "cp '$BAK' '$PROPS'" EXIT
sed -i "/^distributionUrl/s =.\+ =file\\://$GRADLE_ZIP " "$PROPS"
flutter --no-version-check "$@"