Skip to content

Commit

Permalink
[Fix] Pwa2Apk action fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Om-Thorat committed Dec 12, 2023
1 parent e1e507b commit 9a03926
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .github/actions/pwa2Apk/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM ubuntu
USER root
COPY entrypoint.sh /entrypoint.sh
RUN apt update
RUN apt -y install curl gnupg wget unzip
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash -
RUN chmod +x /entrypoint.sh
RUN apt -y install nodejs
RUN npm install npm@latest -g
RUN npm i -g @bubblewrap/cli
ENTRYPOINT ["/entrypoint.sh"]
17 changes: 17 additions & 0 deletions .github/actions/pwa2Apk/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: 'PWA to APK action'
description: 'Github Action for Converting your PWA to APK.'
branding:
icon: 'package'
color: 'orange'
inputs:
project-root-folder:
description: 'Root folder for project generated by bubblewrap-cli'
required: true
outputs:
message:
description: "Status message from build script"
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.project-root-folder }}
8 changes: 8 additions & 0 deletions .github/actions/pwa2Apk/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh -l

echo "========================= Changing directory to $1 ========================="
cd $1
echo "========================= Building APK, it may take 3-4 minutes or more ========================="
( sleep 5 && while [ 1 ]; do sleep 1; echo y; done ) | bubblewrap build --skipPwaValidation --skipSigning
cp ./*.apk ..
echo "========================= APK building finished ========================="
4 changes: 2 additions & 2 deletions .github/workflows/build_apk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
# Running PWA to apk action for apk generation
- name: Running PWA to APK action
uses: sharadcodes/[email protected]
- name: Running PWA2Apk
uses: ./.github/actions/pwa2Apk
with:
project-root-folder: "."
# This one below is a seperate action which I'm using for releasing apk
Expand Down

0 comments on commit 9a03926

Please sign in to comment.