2023-03-23 17:34:52 +01:00
|
|
|
name: Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- dev
|
|
|
|
jobs:
|
|
|
|
release:
|
|
|
|
name: Release
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
# Make sure the release step uses its own credentials:
|
|
|
|
# https://github.com/cycjimmy/semantic-release-action#private-packages
|
|
|
|
persist-credentials: false
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Setup JDK
|
|
|
|
uses: actions/setup-java@v3
|
|
|
|
with:
|
|
|
|
java-version: '17'
|
|
|
|
distribution: 'zulu'
|
2023-03-26 15:02:56 +02:00
|
|
|
cache: 'gradle'
|
2023-03-23 17:34:52 +01:00
|
|
|
- name: Setup Node.js
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: '18'
|
|
|
|
cache: 'npm'
|
|
|
|
- name: Setup Flutter
|
|
|
|
uses: subosito/flutter-action@v2
|
|
|
|
with:
|
|
|
|
channel: 'stable'
|
2023-03-26 15:02:56 +02:00
|
|
|
cache: true
|
2023-03-23 17:34:52 +01:00
|
|
|
- name: Install Flutter dependencies
|
|
|
|
run: flutter pub get
|
|
|
|
- name: Generate files with Builder
|
|
|
|
run: flutter packages pub run build_runner build --delete-conflicting-outputs
|
|
|
|
- name: Build with Flutter
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
run: flutter build apk
|
|
|
|
- name: Sign APK
|
|
|
|
id: sign_apk
|
|
|
|
uses: ilharp/sign-android-release@v1
|
|
|
|
with:
|
|
|
|
releaseDir: build/app/outputs/apk/release
|
|
|
|
signingKey: ${{ secrets.SIGNING_KEYSTORE }}
|
|
|
|
keyStorePassword: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }}
|
|
|
|
keyAlias: ${{ secrets.SIGNING_KEY_ALIAS }}
|
|
|
|
keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }}
|
|
|
|
- name: Setup semantic-release
|
2023-03-26 16:42:15 +02:00
|
|
|
run: npm ci
|
2023-03-23 17:34:52 +01:00
|
|
|
- name: Get release version
|
2023-03-26 18:00:37 +02:00
|
|
|
run: npm exec -- semantic-release --dry-run
|
2023-03-23 17:34:52 +01:00
|
|
|
id: get-next-version
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Add version to APK
|
2023-03-26 16:34:38 +02:00
|
|
|
run: mv $SIGNED_FILE_PATH $(dirname $SIGNED_FILE_PATH)/revanced-manager-${{ steps.get-next-version.outputs.new-release-version }}.apk
|
|
|
|
env:
|
|
|
|
SIGNED_FILE_PATH: ${{steps.sign_apk.outputs.signedFile}}
|
2023-03-23 17:34:52 +01:00
|
|
|
- name: Release
|
|
|
|
env:
|
2023-04-20 21:58:50 +02:00
|
|
|
GITHUB_TOKEN: ${{ secrets.REPOSITORY_PUSH_ACCESS }}
|
2023-03-26 15:02:56 +02:00
|
|
|
run: npm exec semantic-release
|