57 lines
2.0 KiB
YAML
57 lines
2.0 KiB
YAML
name: Publish tagged release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*'
|
|
|
|
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: Release
|
|
id: use-go-action
|
|
uses: https://gitea.com/actions/release-action@main
|
|
with:
|
|
files: |-
|
|
app/build/outputs/apk/release/app-release.apk
|
|
app/build/outputs/bundle/release/app-release.aab
|
|
api_key: '${{secrets.RELEASE_TOKEN}}'
|
|
|
|
- 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 |