mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-05-01 11:04:26 +00:00
Updated workflows
This commit is contained in:
parent
1321d14cdb
commit
b2795d71c9
2 changed files with 105 additions and 44 deletions
14
.github/workflows/release-beta.yaml
vendored
14
.github/workflows/release-beta.yaml
vendored
|
@ -35,7 +35,10 @@ jobs:
|
|||
msg: "${{ steps.read_pubspec.outputs.data }}"
|
||||
separator: "+"
|
||||
- name: Save version on env variable
|
||||
run: echo "VERSION_NAME=$(echo ${{ steps.splitted_version.outputs._0 }})" >> $GITHUB_ENV
|
||||
run: |
|
||||
echo "VERSION_NAME=$(echo ${{ steps.splitted_version.outputs._0 }})" >> $GITHUB_ENV
|
||||
echo "::set-output name=version_name::${{ steps.splitted_version.outputs._0 }}"
|
||||
echo "::set-output name=version_number::${{ steps.splitted_version.outputs._1 }}"
|
||||
- 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
|
||||
|
@ -70,8 +73,9 @@ jobs:
|
|||
name: Release beta build to GitHub
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build-android]
|
||||
env:
|
||||
VERSION_NAME: ${{ github.event.inputs.version }}-beta.${{ github.event.inputs.beta-number }}
|
||||
env:
|
||||
VERSION_NAME: ${{ needs.build-android.outputs.version_name }}
|
||||
VERSION_NUMBER: ${{ needs.build-android.outputs.version_number }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
|
@ -88,7 +92,7 @@ jobs:
|
|||
with:
|
||||
artifacts: "releases/*"
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
tag: '${{ env.VERSION_NAME }}_(${{ github.event.inputs.number }})'
|
||||
tag: '${{ env.VERSION_NAME }}_(${{ env.VERSION_NUMBER }})'
|
||||
name: v${{ env.VERSION_NAME }}
|
||||
draft: true
|
||||
prerelease: true
|
||||
|
@ -98,7 +102,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
needs: [build-android]
|
||||
env:
|
||||
VERSION_NAME: ${{ github.event.inputs.version }}-beta.${{ github.event.inputs.beta-number }}
|
||||
VERSION_NAME: ${{ needs.build-android.outputs.version_name }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
|
|
135
.github/workflows/release-stable.yaml
vendored
135
.github/workflows/release-stable.yaml
vendored
|
@ -2,15 +2,8 @@ name: Compile and release production build
|
|||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: "Version"
|
||||
required: true
|
||||
default: "1.0.0"
|
||||
number:
|
||||
description: "Build number"
|
||||
required: true
|
||||
default: "1"
|
||||
branches:
|
||||
- master
|
||||
jobs:
|
||||
build-android:
|
||||
name: Build Android .apk and .aab
|
||||
|
@ -26,8 +19,23 @@ jobs:
|
|||
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: Read pubspec.yaml
|
||||
uses: jbutcher5/read-yaml@1.6
|
||||
id: read_pubspec
|
||||
with:
|
||||
file: './pubspec.yaml'
|
||||
key-path: '["version"]'
|
||||
- name: Split version string
|
||||
uses: winterjung/split@v2
|
||||
id: splitted_version
|
||||
with:
|
||||
msg: "${{ steps.read_pubspec.outputs.data }}"
|
||||
separator: "+"
|
||||
- name: Save version on env variable
|
||||
run: |
|
||||
echo "VERSION_NAME=$(echo ${{ steps.splitted_version.outputs._0 }})" >> $GITHUB_ENV
|
||||
echo "::set-output name=version_name::${{ steps.splitted_version.outputs._0 }}"
|
||||
echo "::set-output name=version_number::${{ steps.splitted_version.outputs._1 }}"
|
||||
- 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
|
||||
|
@ -44,20 +52,20 @@ jobs:
|
|||
- run: flutter build apk --release
|
||||
- run: flutter build appbundle --release
|
||||
- name: Rename apk
|
||||
run: mv $ANDROID_APK_RELEASE_PATH/app-release.apk $ANDROID_APK_RELEASE_PATH/AdGuardHomeManager_${{ github.event.inputs.version }}_Android.apk
|
||||
run: mv $ANDROID_APK_RELEASE_PATH/app-release.apk $ANDROID_APK_RELEASE_PATH/AdGuardHomeManager_${{ env.VERSION_NAME }}_Android.apk
|
||||
- name: Rename aab
|
||||
run: mv $ANDROID_AAB_RELEASE_PATH/app-release.aab $ANDROID_AAB_RELEASE_PATH/AdGuardHomeManager_${{ github.event.inputs.version }}_Android.aab
|
||||
run: mv $ANDROID_AAB_RELEASE_PATH/app-release.aab $ANDROID_AAB_RELEASE_PATH/AdGuardHomeManager_${{ env.VERSION_NAME }}_Android.aab
|
||||
- name: Copy apk to project root
|
||||
run: cp $ANDROID_APK_RELEASE_PATH/AdGuardHomeManager_${{ github.event.inputs.version }}_Android.apk AdGuardHomeManager_${{ github.event.inputs.version }}_Android.apk
|
||||
run: cp $ANDROID_APK_RELEASE_PATH/AdGuardHomeManager_${{ env.VERSION_NAME }}_Android.apk AdGuardHomeManager_${{ env.VERSION_NAME }}_Android.apk
|
||||
- name: Copy aab to project root
|
||||
run: cp $ANDROID_AAB_RELEASE_PATH/AdGuardHomeManager_${{ github.event.inputs.version }}_Android.aab AdGuardHomeManager_${{ github.event.inputs.version }}_Android.aab
|
||||
run: cp $ANDROID_AAB_RELEASE_PATH/AdGuardHomeManager_${{ env.VERSION_NAME }}_Android.aab AdGuardHomeManager_${{ env.VERSION_NAME }}_Android.aab
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: android
|
||||
path: |
|
||||
AdGuardHomeManager_${{ github.event.inputs.version }}_Android.aab
|
||||
AdGuardHomeManager_${{ github.event.inputs.version }}_Android.apk
|
||||
AdGuardHomeManager_${{ env.VERSION_NAME }}_Android.aab
|
||||
AdGuardHomeManager_${{ env.VERSION_NAME }}_Android.apk
|
||||
build-macos:
|
||||
name: Build macOS .dmg
|
||||
runs-on: macos-latest
|
||||
|
@ -67,8 +75,23 @@ jobs:
|
|||
- uses: actions/checkout@v3
|
||||
- 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: Read pubspec.yaml
|
||||
uses: jbutcher5/read-yaml@1.6
|
||||
id: read_pubspec
|
||||
with:
|
||||
file: './pubspec.yaml'
|
||||
key-path: '["version"]'
|
||||
- name: Split version string
|
||||
uses: winterjung/split@v2
|
||||
id: splitted_version
|
||||
with:
|
||||
msg: "${{ steps.read_pubspec.outputs.data }}"
|
||||
separator: "+"
|
||||
- name: Save version on env variable
|
||||
run: |
|
||||
echo "VERSION_NAME=$(echo ${{ steps.splitted_version.outputs._0 }})" >> $GITHUB_ENV
|
||||
echo "::set-output name=version_name::${{ steps.splitted_version.outputs._0 }}"
|
||||
echo "::set-output name=version_number::${{ steps.splitted_version.outputs._1 }}"
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: "stable"
|
||||
|
@ -96,14 +119,14 @@ jobs:
|
|||
- name: Generate symbolic link to Applications dir
|
||||
run: ln -s /Applications $MACOS_APP_RELEASE_PATH/AdGuard\ Home\ Manager
|
||||
- name: Generate dmg
|
||||
run: hdiutil create -srcfolder $MACOS_APP_RELEASE_PATH/AdGuard\ Home\ Manager $MACOS_APP_RELEASE_PATH/AdGuardHomeManager_${{ github.event.inputs.version }}_macOS_Universal.dmg
|
||||
run: hdiutil create -srcfolder $MACOS_APP_RELEASE_PATH/AdGuard\ Home\ Manager $MACOS_APP_RELEASE_PATH/AdGuardHomeManager_${{ env.VERSION_NAME }}_macOS_Universal.dmg
|
||||
- name: Copy dmg to project root
|
||||
run: cp $MACOS_APP_RELEASE_PATH/AdGuardHomeManager_${{ github.event.inputs.version }}_macOS_Universal.dmg AdGuardHomeManager_${{ github.event.inputs.version }}_macOS_Universal.dmg
|
||||
run: cp $MACOS_APP_RELEASE_PATH/AdGuardHomeManager_${{ env.VERSION_NAME }}_macOS_Universal.dmg AdGuardHomeManager_${{ env.VERSION_NAME }}_macOS_Universal.dmg
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: macos
|
||||
path: AdGuardHomeManager_${{ github.event.inputs.version }}_macOS_Universal.dmg
|
||||
path: AdGuardHomeManager_${{ env.VERSION_NAME }}_macOS_Universal.dmg
|
||||
build-linux:
|
||||
name: Build Linux .tar.gz and .deb
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -111,10 +134,25 @@ jobs:
|
|||
- uses: actions/checkout@v3
|
||||
- name: Decode .env
|
||||
run: echo "${{ secrets.ENV }}" | base64 --decode > .env
|
||||
- name: Update version in pubspec.yaml
|
||||
run: sed -i 's/99.99.99+99/${{ github.event.inputs.version }}+${{ github.event.inputs.number }}/g' pubspec.yaml
|
||||
- name: Read pubspec.yaml
|
||||
uses: jbutcher5/read-yaml@1.6
|
||||
id: read_pubspec
|
||||
with:
|
||||
file: './pubspec.yaml'
|
||||
key-path: '["version"]'
|
||||
- name: Split version string
|
||||
uses: winterjung/split@v2
|
||||
id: splitted_version
|
||||
with:
|
||||
msg: "${{ steps.read_pubspec.outputs.data }}"
|
||||
separator: "+"
|
||||
- name: Save version on env variable
|
||||
run: |
|
||||
echo "VERSION_NAME=$(echo ${{ steps.splitted_version.outputs._0 }})" >> $GITHUB_ENV
|
||||
echo "::set-output name=version_name::${{ steps.splitted_version.outputs._0 }}"
|
||||
echo "::set-output name=version_number::${{ steps.splitted_version.outputs._1 }}"
|
||||
- name: Update version in debian.yaml
|
||||
run: sed -i 's/<REPLACE_VERSION_NUMBER_ACTIONS>/${{ github.event.inputs.version }}/g' debian/debian.yaml
|
||||
run: sed -i 's/<REPLACE_VERSION_NUMBER_ACTIONS>/${{ env.VERSION_NAME }}/g' debian/debian.yaml
|
||||
- name: Update dependencies list
|
||||
run: sudo apt-get update
|
||||
- name: Install dependencies
|
||||
|
@ -130,7 +168,7 @@ jobs:
|
|||
- name: Generate .deb package
|
||||
run: flutter_to_debian
|
||||
- name: Move .deb package to project root
|
||||
run: mv debian/packages/AdGuardHomeManager_${{ github.event.inputs.version }}_amd64.deb AdGuardHomeManager_${{ github.event.inputs.version }}_Linux_amd64.deb
|
||||
run: mv debian/packages/AdGuardHomeManager_${{ env.VERSION_NAME }}_amd64.deb AdGuardHomeManager_${{ env.VERSION_NAME }}_Linux_amd64.deb
|
||||
- name: Generate .tar.gz package
|
||||
uses: a7ul/tar-action@v1.1.3
|
||||
id: compress
|
||||
|
@ -141,14 +179,14 @@ jobs:
|
|||
./data
|
||||
./lib
|
||||
./AdGuardHomeManager
|
||||
outPath: AdGuardHomeManager_${{ github.event.inputs.version }}_Linux.tar.gz
|
||||
outPath: AdGuardHomeManager_${{ env.VERSION_NAME }}_Linux.tar.gz
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: linux
|
||||
path: |
|
||||
AdGuardHomeManager_${{ github.event.inputs.version }}_Linux_amd64.deb
|
||||
AdGuardHomeManager_${{ github.event.inputs.version }}_Linux.tar.gz
|
||||
AdGuardHomeManager_${{ env.VERSION_NAME }}_Linux_amd64.deb
|
||||
AdGuardHomeManager_${{ env.VERSION_NAME }}_Linux.tar.gz
|
||||
build-windows:
|
||||
name: Build Windows installer
|
||||
runs-on: windows-latest
|
||||
|
@ -158,13 +196,27 @@ jobs:
|
|||
shell: pwsh
|
||||
run: |
|
||||
[IO.File]::WriteAllBytes('.env', [Convert]::FromBase64String('${{ secrets.ENV }}'))
|
||||
- name: Update version in pubspec.yaml
|
||||
shell: bash
|
||||
run: sed -i 's/99.99.99+99/${{ github.event.inputs.version }}+${{ github.event.inputs.number }}/g' pubspec.yaml
|
||||
- name: Read pubspec.yaml
|
||||
uses: jbutcher5/read-yaml@1.6
|
||||
id: read_pubspec
|
||||
with:
|
||||
file: './pubspec.yaml'
|
||||
key-path: '["version"]'
|
||||
- name: Split version string
|
||||
uses: winterjung/split@v2
|
||||
id: splitted_version
|
||||
with:
|
||||
msg: "${{ steps.read_pubspec.outputs.data }}"
|
||||
separator: "+"
|
||||
- name: Save version on env variable
|
||||
run: |
|
||||
echo "VERSION_NAME=$(echo ${{ steps.splitted_version.outputs._0 }})" >> $GITHUB_ENV
|
||||
echo "::set-output name=version_name::${{ steps.splitted_version.outputs._0 }}"
|
||||
echo "::set-output name=version_number::${{ steps.splitted_version.outputs._1 }}"
|
||||
- name: Update version in innosetup config file
|
||||
shell: pwsh
|
||||
run: |
|
||||
(Get-Content windows/innosetup_installer_builder.iss) -replace '<REPLACE_VERSION_ACTIONS>', '${{ github.event.inputs.version }}' | Out-File -encoding ASCII windows/innosetup_installer_builder.iss
|
||||
(Get-Content windows/innosetup_installer_builder.iss) -replace '<REPLACE_VERSION_ACTIONS>', '${{ env.VERSION_NAME }}' | Out-File -encoding ASCII windows/innosetup_installer_builder.iss
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: "stable"
|
||||
|
@ -174,16 +226,19 @@ jobs:
|
|||
- name: Build installer witn innosetup
|
||||
run: iscc /Q windows/innosetup_installer_builder.iss
|
||||
- name: Move installer file to root directory
|
||||
run: move build/windows/aghm_installer.exe AdGuardHomeManager_${{ github.event.inputs.version }}_Windows_x64.exe
|
||||
run: move build/windows/aghm_installer.exe AdGuardHomeManager_${{ env.VERSION_NAME }}_Windows_x64.exe
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: windows
|
||||
path: AdGuardHomeManager_${{ github.event.inputs.version }}_Windows_x64.exe
|
||||
path: AdGuardHomeManager_${{ env.VERSION_NAME }}_Windows_x64.exe
|
||||
release-builds-github:
|
||||
name: Release builds to GitHub
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build-android, build-macos, build-linux, build-windows]
|
||||
env:
|
||||
VERSION_NAME: ${{ needs.build-android.outputs.version_name }}
|
||||
VERSION_NUMBER: ${{ needs.build-android.outputs.version_number }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Create builds directory
|
||||
|
@ -213,8 +268,8 @@ jobs:
|
|||
with:
|
||||
artifacts: "releases/*"
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
tag: '${{ github.event.inputs.version }}_(${{ github.event.inputs.number }})'
|
||||
name: v${{ github.event.inputs.version }}
|
||||
tag: '${{ env.VERSION_NAME }}_(${{ env.VERSION_NUMBER }})'
|
||||
name: v${{ env.VERSION_NAME }}
|
||||
draft: true
|
||||
prerelease: false
|
||||
commit: ${{ github.sha }}
|
||||
|
@ -222,6 +277,8 @@ jobs:
|
|||
name: Release Android build to the Google Play Store
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build-android, build-macos, build-linux, build-windows]
|
||||
env:
|
||||
VERSION_NAME: ${{ needs.build-android.outputs.version_name }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Download Android artifacts
|
||||
|
@ -233,7 +290,7 @@ jobs:
|
|||
with:
|
||||
serviceAccountJsonPlainText: ${{ secrets.PLAYSTORE_ACCOUNT_KEY }}
|
||||
packageName: com.jgeek00.adguard_home_manager
|
||||
releaseFiles: AdGuardHomeManager_${{ github.event.inputs.version }}_Android.aab
|
||||
releaseFiles: AdGuardHomeManager_${{ env.VERSION_NAME }}_Android.aab
|
||||
track: production
|
||||
status: draft
|
||||
releaseName: ${{ github.event.inputs.version }}
|
||||
releaseName: ${{ env.VERSION_NAME }}
|
Loading…
Add table
Reference in a new issue