mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-06-17 11:59:37 +00:00
55 lines
No EOL
2.4 KiB
YAML
55 lines
No EOL
2.4 KiB
YAML
name: Release build
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: "Version"
|
|
default: "1.0.0"
|
|
number:
|
|
description: "Build number"
|
|
default: "1"
|
|
jobs:
|
|
build:
|
|
name: Build APK and Create release
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Decode android/app/keystore.jks
|
|
run: echo "${{ secrets.KEYSTORE_JKS }}" | base64 --decode > android/app/keystore.jks
|
|
- name: Decode android/key.properties
|
|
run: echo "${{ secrets.KEY_PROPERTIES }}" | base64 --decode > android/key.properties
|
|
- name: Decode .env
|
|
run: echo "${{ secrets.ENV }}" | base64 --decode > .env
|
|
- name: Update version in YAML
|
|
run: sed -i 's/99.99.99+99/${{ github.event.inputs.version }}+${{ github.event.inputs.number }}/g' pubspec.yaml
|
|
- name: Update KeyStore password in gradle properties
|
|
run: sed -i 's/#{KEYSTORE_PASS}#/${{ secrets.KEYSTORE_PASS }}/g' android/key.properties
|
|
- name: Update KeyStore key password in gradle properties
|
|
run: sed -i 's/#{KEYSTORE_KEY_PASS}#/${{ secrets.KEYSTORE_KEY_PASS }}/g' android/key.properties
|
|
- uses: actions/setup-java@v1
|
|
with:
|
|
java-version: "18.x"
|
|
- uses: subosito/flutter-action@v1
|
|
with:
|
|
channel: "stable"
|
|
- run: flutter clean
|
|
- run: flutter pub get
|
|
- run: flutter build apk --release
|
|
- run: flutter build appbundle --release
|
|
- name: Rename apk
|
|
run: mv build/app/outputs/apk/release/app-release.apk build/app/outputs/apk/release/AdGuardHomeManager_${{ github.event.inputs.version }}_Android.apk
|
|
- name: Rename aab
|
|
run: mv build/app/outputs/bundle/release/app-release.aab build/app/outputs/bundle/release/AdGuardHomeManager_${{ github.event.inputs.version }}_Android.aab
|
|
- name: Create a Release in GitHub
|
|
uses: ncipollo/release-action@v1
|
|
with:
|
|
artifacts: "build/app/outputs/apk/release/AdGuardHomeManager_${{ github.event.inputs.version }}_Android.apk,build/app/outputs/bundle/release/AdGuardHomeManager_${{ github.event.inputs.version }}_Android.aab"
|
|
token: ${{ secrets.GH_TOKEN }}
|
|
tag: ${{ github.event.inputs.version }}
|
|
commit: ${{ github.sha }}
|
|
- name: Upload app bundle
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: appbundle
|
|
path: build/app/outputs/bundle/release/app-release.aab |