Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Update stable.md

Update stable.md #3

Workflow file for this run

name: Android CI Beta
on:
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- '**/README.md'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set variables
run: |
VER=$(grep -E -o "versionName \".*\"" app/build.gradle | sed -e 's/versionName //g' | tr -d '"')
SHA=${{ github.sha }}
VERSION="$VER.${SHA:0:7}"
echo "Version $VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Cook KeyStore
run: echo "${{ secrets.KEYSTORE_B64 }}" | base64 -d > $GITHUB_WORKSPACE/signing-key.jks
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew assembleDebug
-Pandroid.injected.signing.store.file=$GITHUB_WORKSPACE/signing-key.jks
-Pandroid.injected.signing.store.password=${{ secrets.PASSWORD }}
-Pandroid.injected.signing.key.alias=key0
-Pandroid.injected.signing.key.password=${{ secrets.PASSWORD }}
shell: bash
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3.0.0
with:
path: "app/build/outputs/apk/debug/app-debug.apk"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.VERSION }}
release_name: Saikou Beta ${{ env.VERSION }}
body: ${{ github.event.head_commit.message }}
draft: false
prerelease: true
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: "app/build/outputs/apk/debug/app-debug.apk"
asset_name: Saikou-${{ env.VERSION }}.apk
asset_content_type: application/vnd.android.package-archive
# - name: Upload APK to Discord
# shell: bash
# run: |
# contentbody=$( jq -Rsa . <<< "${{ github.event.head_commit.message }}" )
# curl -F "payload_json={\"content\":\"<@&1127494815693684826> **${{ env.VERSION }}**\n\n${contentbody:1:-1}\"}" -F "saikou_debug=@app/build/outputs/apk/debug/app-debug.apk" ${{ secrets.DISCORD_WEBHOOK_URL }}
- name: Delete Old Pre-Releases
id: delete-pre-releases
uses: sgpublic/delete-release-action@master
with:
pre-release-drop: true
pre-release-keep-count: 3
pre-release-drop-tag: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}