diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 89af6fd62..eb3e4ffc3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -65,7 +65,6 @@ jobs: description: 'Deployment ${{ steps.version.outputs.version }} from branch ${{ steps.branch.outputs.branch-name }}' task: release - - name: Download all artifacts if: ${{ inputs.release_type != 'Dry Run' }} uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe # v3.1.4 @@ -152,9 +151,7 @@ jobs: node-version: '16.x' - name: Set up F-Droid server - run: | - sudo apt-get -qq update - sudo apt-get -qqy install --no-install-recommends fdroidserver wget + run: pip install git+https://gitlab.com/fdroid/fdroidserver.git - name: Set up Git credentials env: @@ -167,9 +164,10 @@ jobs: - name: Print environment run: | - node --version - npm --version - git --version + echo "Node Version: $(node --version)" + echo "NPM Version: $(npm --version)" + echo "Git Version: $(git --version)" + echo "F-Droid Server Version: $(fdroid --version)" echo "GitHub ref: $GITHUB_REF" echo "GitHub event: $GITHUB_EVENT" @@ -194,27 +192,30 @@ jobs: env: FDROID_STORE_KEYSTORE_PASSWORD: ${{ secrets.FDROID_STORE_KEYSTORE_PASSWORD }} run: | - cd $GITHUB_WORKSPACE + # Create required directories. mkdir dist - cp CNAME ./dist - cd store - chmod 600 fdroid/config.py fdroid/keystore.jks - mkdir -p temp/fdroid + mkdir -p store/temp/fdroid + mkdir -p store/fdroid/repo + + # Configure F-Droid server. + cp CNAME dist/ + chmod 600 store/fdroid/config.yml store/fdroid/keystore.jks TEMP_DIR="$GITHUB_WORKSPACE/store/temp/fdroid" - cd fdroid - echo "keypass=\"$FDROID_STORE_KEYSTORE_PASSWORD\"" >>config.py - echo "keystorepass=\"$FDROID_STORE_KEYSTORE_PASSWORD\"" >>config.py - echo "local_copy_dir=\"$TEMP_DIR\"" >>config.py - mkdir -p repo - mv $GITHUB_WORKSPACE/com.x8bit.bitwarden-fdroid.apk ./repo/ + echo "keypass: $FDROID_STORE_KEYSTORE_PASSWORD" >> store/fdroid/config.yml + echo "keystorepass: $FDROID_STORE_KEYSTORE_PASSWORD" >> store/fdroid/config.yml + echo "local_copy_dir: $TEMP_DIR" >> store/fdroid/config.yml + mv $GITHUB_WORKSPACE/com.x8bit.bitwarden-fdroid.apk store/fdroid/repo/ + + # Run update and deploy. + cd store/fdroid fdroid update - fdroid server update - cd .. - rm -rf temp/fdroid/archive - mv -v temp/fdroid ../dist - cd fdroid - cp index.html btn.png qr.png ../../dist/fdroid - cd $GITHUB_WORKSPACE + fdroid deploy + cd ../.. + + # Move files for distribution. + rm -rf store/temp/fdroid/archive + mv -v store/temp/fdroid dist + cp store/fdroid/index.html store/fdroid/btn.png store/fdroid/qr.png dist/fdroid - name: Deploy to gh-pages if: ${{ inputs.release_type != 'Dry Run' }} diff --git a/store/fdroid/config.py b/store/fdroid/config.py deleted file mode 100644 index db8222a4f..000000000 --- a/store/fdroid/config.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 - -repo_url = "https://mobileapp.bitwarden.com/fdroid/repo" -repo_name = "Bitwarden F-Droid Repo" -repo_icon = "fdroid-icon.png" -repo_description = """ -F-Droid repo for Bitwarden. -""" - -archive_older = 2 -archive_url = "https://does.not.exist" -archive_name = "Bitwarden Archive Repo" -archive_icon = "fdroid-icon.png" -archive_description = """ -F-Droid archive repo for Bitwarden. -""" - -repo_keyalias = "bitwarden-Virtual-Machine" -keystore = "keystore.jks" -keydname = "CN=bitwarden-Virtual-Machine, OU=F-Droid" diff --git a/store/fdroid/config.yml b/store/fdroid/config.yml new file mode 100644 index 000000000..d0267aba3 --- /dev/null +++ b/store/fdroid/config.yml @@ -0,0 +1,18 @@ +--- + +repo_url: https://mobileapp.bitwarden.com/fdroid/repo +repo_name: Bitwarden F-Droid Repo +repo_icon: fdroid-icon.png +repo_description: >- + F-Droid repo for Bitwarden. + +archive_older: 2 +archive_url: https://does.not.exist/archive +archive_name: Bitwarden Archive Repo +archive_icon: fdroid-icon.png +archive_description: >- + F-Droid archive repo for Bitwarden. + +repo_keyalias: bitwarden-Virtual-Machine +keystore: keystore.jks +keydname: CN=bitwarden-Virtual-Machine, OU=F-Droid