Publish fdroid repo #280
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish fdroid repo | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 4 */2 * *' | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Setup keystore | |
run: | | |
echo "${{ secrets.KEYSTORE }}" | base64 -d > fdroid/keystore.jks | |
chmod 600 fdroid/config.py fdroid/keystore.jks | |
- name: Install fdroid | |
run: | | |
sudo apt update | |
sudo apt install -y wget p7zip-full software-properties-common fdroidserver ca-certificates | |
- name: Setup downloader deps | |
run: | | |
mkdir -p fdroid/repo | |
python3 -m pip install -r downloader/requirements.txt | |
echo "${{ secrets.TG_SESSION }}" | base64 -d > main.session | |
wget "https://github.com/REAndroid/APKEditor/releases/download/V1.2.7/APKEditor-1.2.7.jar" -O APKEditor.jar | |
- name: Fetch apks | |
run: python3 ./downloader/main.py | |
env: | |
TG_ID: ${{ secrets.TG_ID }} | |
TG_HASH: ${{ secrets.TG_HASH }} | |
KEYSTOREPASS: ${{ secrets.KEYSTOREPASS }} | |
- name: List apks | |
run: ls -lah fdroid/repo/**.apk | |
- name: Build fdroid | |
run: | | |
cd fdroid | |
fdroid update -c | |
sudo mkdir /fdroid | |
sudo chown $USER /fdroid | |
fdroid deploy | |
rm -rf /fdroid/archive | |
cd .. | |
mkdir public | |
mv -v /fdroid/* public/ | |
cp index.html public/ | |
cp index.html public/repo/ | |
cp index.html public/404.html | |
env: | |
KEYSTOREPASS: ${{ secrets.KEYSTOREPASS }} | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: public | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |