diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 195de40..0000000 --- a/.drone.yml +++ /dev/null @@ -1,89 +0,0 @@ ---- -kind: pipeline -type: docker -name: Android - -steps: -- name: prepare signing - image: busybox - environment: - STOREPASSWORD: - from_secret: StorePassword - KEYPASSWORD: - from_secret: KeyPassword - commands: - - touch keystore.properties - - echo "storePassword=$STOREPASSWORD" >> keystore.properties - - echo "keyPassword=$KEYPASSWORD" >> keystore.properties - - echo "keyAlias=key0" >> keystore.properties - - echo "storeFile=../AndroidKey" >> keystore.properties - -- name: generate versionCode - image: busybox - commands: - - touch version.properties - - let timestamp=$(date +%s)/10 - - echo "versionCode=$timestamp" >> version.properties - -- name: build - image: mingc/android-build-box - commands: - - ./gradlew test - - ./gradlew assembleRelease - - ./gradlew bundleRelease - -- name: upload latest apk - image: vividboarder/drone-webdav - settings: - file: app/build/outputs/apk/release/app-release.apk - destination: https://nextcloud.zobrist.me/remote.php/dav/files/deploy/TichuCounter/latest/app-release.apk - username: - from_secret: NextCloudUser - password: - from_secret: NextCloudPassword - -- name: upload latest bundle - image: vividboarder/drone-webdav - settings: - file: app/build/outputs/bundle/release/app-release.aab - destination: https://nextcloud.zobrist.me/remote.php/dav/files/deploy/TichuCounter/latest/app-release.aab - username: - from_secret: NextCloudUser - password: - from_secret: NextCloudPassword - -- name: upload tagged apk - image: vividboarder/drone-webdav - settings: - file: app/build/outputs/apk/release/app-release.apk - destination: 'https://nextcloud.zobrist.me/remote.php/dav/files/deploy/TichuCounter/tagged/app-release$DRONE_TAG.apk' - username: - from_secret: NextCloudUser - password: - from_secret: NextCloudPassword - when: - event: - - tag - -- name: upload tagged bundle - image: vividboarder/drone-webdav - settings: - file: app/build/outputs/bundle/release/app-release.aab - destination: 'https://nextcloud.zobrist.me/remote.php/dav/files/deploy/TichuCounter/tagged/app-release$DRONE_TAG.aab' - username: - from_secret: NextCloudUser - password: - from_secret: NextCloudPassword - when: - event: - - tag - -- name: slack notification - image: plugins/slack - settings: - webhook: - from_secret: SlackWebhook - when: - status: - - failure - - success \ No newline at end of file diff --git a/.gitea/workflows/buildAndroid.yaml b/.gitea/workflows/buildAndroid.yaml new file mode 100644 index 0000000..501fc60 --- /dev/null +++ b/.gitea/workflows/buildAndroid.yaml @@ -0,0 +1,48 @@ +name: Build Android +on: [pull_request, push] +jobs: + build: + runs-on: ubuntu-latest-android + steps: + - name: Checkout the code + uses: actions/checkout@v2 + + - name: Prepare signing + run: | + touch keystore.properties + echo "storePassword=${{ secrets.STOREPASSWORD }}" >> keystore.properties + echo "keyPassword=${{ secrets.KEYPASSWORD }}" >> keystore.properties + echo "keyAlias=key0" >> keystore.properties + echo "storeFile=../AndroidKey" >> keystore.properties + + - name: Generate versionCode + run: | + touch version.properties + let timestamp=$(date +%s)/10 + echo "versionCode=$timestamp" >> version.properties + + - name: Test the app + run: ./gradlew test + + - name: Build apk + run: ./gradlew assembleRelease + + - name: Build abb + run: ./gradlew bundleRelease + + - name: Deploy latest to Nextcloud + run: | + curl -k -u "${{ secrets.NEXTCLOUD_USERNAME }}:${{ secrets.NEXTCLOUD_PASSWORD }}" -T "app/build/outputs/apk/release/app-release.apk" "https://nextcloud.zobrist.me/remote.php/dav/files/deploy/TichuCounter/latest/app-release.apk" + curl -k -u "${{ secrets.NEXTCLOUD_USERNAME }}:${{ secrets.NEXTCLOUD_PASSWORD }}" -T "app/build/outputs/bundle/release/app-release.aab" "https://nextcloud.zobrist.me/remote.php/dav/files/deploy/TichuCounter/latest/app-release.aab" + + - name: Deploy tagged build to Nextcloud + run: | + curl -k -u "${{ secrets.NEXTCLOUD_USERNAME }}:${{ secrets.NEXTCLOUD_PASSWORD }}" -T "app/build/outputs/apk/release/app-release.apk" "https://nextcloud.zobrist.me/remote.php/dav/files/deploy/TichuCounter/tagged/app-release-${GITHUB_REF_NAME##*/}.apk" + curl -k -u "${{ secrets.NEXTCLOUD_USERNAME }}:${{ secrets.NEXTCLOUD_PASSWORD }}" -T "app/build/outputs/bundle/release/app-release.aab" "https://nextcloud.zobrist.me/remote.php/dav/files/deploy/TichuCounter/tagged/app-release-${GITHUB_REF_NAME##*/}.aab" + + - uses: https://github.com/ravsamhq/notify-slack-action@v2 + if: always() + with: + status: ${{ job.status }} # required + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required \ No newline at end of file