forked from MapComplete/MapComplete
Scripts: attempt to push to android repo
This commit is contained in:
parent
f6e2147132
commit
1d84929a64
1 changed files with 12 additions and 55 deletions
|
@ -13,8 +13,6 @@ jobs:
|
|||
with:
|
||||
persist-credentials: true
|
||||
|
||||
- uses: https://source.mapcomplete.org/actions/setup-android@v3.2.2
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: https://source.mapcomplete.org/actions/setup-node@v4
|
||||
with:
|
||||
|
@ -32,21 +30,6 @@ jobs:
|
|||
cd android
|
||||
git config --global --add safe.directory $(pwd)
|
||||
|
||||
- name: Update android repo
|
||||
run: |
|
||||
cd android
|
||||
git checkout main
|
||||
git pull
|
||||
git remote set-url origin "https://Bot:${{ secrets.BOT_PASSWORD }}@source.mapcomplete.org/MapComplete/android-wrapper"
|
||||
git config user.name "Bot"
|
||||
git config user.email "info@mapcomplete.org"
|
||||
date > date.txt
|
||||
git add date.txt
|
||||
echo "Committing"
|
||||
git commit -m "Add files for release ${{ github.ref_name }}"
|
||||
git tag "${{ github.ref_name }}"
|
||||
git push origin main --verbose --follow-tags
|
||||
|
||||
- name: install deps
|
||||
run: npm ci
|
||||
shell: bash
|
||||
|
@ -62,43 +45,17 @@ jobs:
|
|||
- name: prepare android build
|
||||
run: npm run android:prepare
|
||||
|
||||
- name: Decode keystore
|
||||
run: |
|
||||
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > ./android/app/release-key.jks
|
||||
pwd
|
||||
echo "Saved release key to ./android/app/release-key.jks"
|
||||
|
||||
- name: Grant execute permission to gradlew
|
||||
run: cd android && chmod +x ./gradlew
|
||||
|
||||
- name: Build signed APK
|
||||
- name: Update android repo
|
||||
run: |
|
||||
cd android
|
||||
export ANDROID_SDK_HOME=/home/runner/.android/sdk/
|
||||
export PATH=$ANDROID_SDK_HOME/tools:$ANDROID_SDK_HOME/platform-tools:$ANDROID_SDK_HOME/:$ANDROID_SDK_HOME/cmdline-tools/latest/tools/bin:$PATH
|
||||
# Those variables are used in MapComplete/android/app/build.gradle
|
||||
export storeFile="./release-key.jks"
|
||||
export storePassword=${{ secrets.KEYSTORE_PASSWORD }}
|
||||
export keyAlias=${{ secrets.KEY_ALIAS }}
|
||||
export keyPassword=${{ secrets.KEY_PASSWORD }}
|
||||
./gradlew build
|
||||
./gradlew assembleRelease
|
||||
|
||||
- name: Upload APK to hetzner
|
||||
shell: bash
|
||||
run: |
|
||||
TAG=$( echo ${{ env.GITHUB_REF_NAME }} )
|
||||
scp android/app/build/outputs/apk/release/app-release.apk hetzner:~/public/apk/mapcomplete-$TAG.apk
|
||||
ssh hetzner 'rm -f public/apk/mapcomplete-latest.apk && cp "public/apk/$(ls -v public/apk/ | tail -n 1)" public/apk/mapcomplete-latest.apk'
|
||||
|
||||
- name: Upload APK to forgejo releases (MapComplete)
|
||||
uses: actions/forgejo-release@v2.6.0
|
||||
with:
|
||||
direction: upload
|
||||
url: https://source.mapcomplete.org
|
||||
repo: MapComplete/MapComplete
|
||||
release-dir: android/app/build/outputs/apk/release//
|
||||
release-notes: "Release version ${{ github.ref_name }}"
|
||||
sha: "${{ github.sha }}"
|
||||
tag: "${{ github.ref_name }}"
|
||||
token: ${{ secrets.WRITE_TOKEN }}
|
||||
git checkout main
|
||||
git pull
|
||||
git remote set-url origin "https://Bot:${{ secrets.BOT_PASSWORD }}@source.mapcomplete.org/MapComplete/android-wrapper"
|
||||
git config user.name "Bot"
|
||||
git config user.email "info@mapcomplete.org"
|
||||
git add *
|
||||
echo "Committing"
|
||||
git commit -m "Add files for release ${{ github.ref_name }}"
|
||||
git tag "${{ gi with:
|
||||
persist-credentials: truethub.ref_name }}"
|
||||
git push origin main --verbose --follow-tags
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue