Skip to content

Create and Release AV Ntfy #13

Create and Release AV Ntfy

Create and Release AV Ntfy #13

name: Create and Release AV Ntfy
on:
# This can be used to automatically publish nightlies at UTC nighttime
#schedule:
# - cron: '0 23 * * *' # run at 2 AM UTC
# This can be used to allow manually triggering nightlies from the web interface
workflow_dispatch:
pull_request:
merge_group:
push:
branches: [ main, develop ]
env:
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx6g -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -Dkotlin.incremental=false -XX:+UseG1GC
CI_GRADLE_ARG_PROPERTIES: --stacktrace --no-daemon -Dsonar.gradle.skipCompile=true
jobs:
nightly:
name: Deploy nightly
concurrency:
group: ${{ format('build-release-main-gplay-{0}', github.sha) }}
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'
- name: Configure gradle
uses: gradle/actions/setup-gradle@v3
- name: Create app bundle
run: ./gradlew assembleRelease $CI_GRADLE_ARG_PROPERTIES
- name: Upload bundle as artifact
uses: actions/upload-artifact@v4
with:
name: ntfy-build-av
path: |
app/build/outputs/apk/play/release/app-play-release.apk
- name: Send to Matrix
uses: daedric7/[email protected]
with:
room_id: ${{ secrets.MATRIX_ROOM_ID }}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
server: "https://aguiarvieira.pt"
file: app/build/outputs/apk/play/release/app-play-release.apk
message: "Build Complete"
- name: Deploy Nightly
uses: WebFreak001/[email protected]
with:
upload_url: https://uploads.github.com/repos/daedric7/ntfy-av/releases/180413350/assets{?name,label} # find out this value by opening https://api.github.com/repos/<owner>/<repo>/releases in your browser and copy the full "upload_url" value including the {?name,label} part
release_id: 180413350 # same as above (id can just be taken out the upload_url, it's used to find old releases)
asset_path: app/build/outputs/apk/play/release/app-play-release.apk # path to archive to upload
asset_name: ntfy-av-$$.apk # name to upload the release as, use $$ to insert date (YYYYMMDD) and 6 letter commit hash
asset_content_type: application/vnd.android.package-archive # required by GitHub API
max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted