-
Notifications
You must be signed in to change notification settings - Fork 1
109 lines (94 loc) · 3.92 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Build Release
on:
push:
tags:
- "v*.*.*"
jobs:
build-windows:
runs-on: windows-latest
permissions:
contents: write
name: Build Flutter App Windows
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Define Artifact Paths
id: define-artifact-paths
run: |
$runner="build/windows/x64/runner"
$build="$runner/Release/"
$archiveName="AndroidSideloader-${{ github.ref_name }}-Windows-Portable.zip"
$archive="$runner/$archiveName"
$installerName="AndroidSideloader-${{ github.ref_name }}-Windows-Installer.exe"
$installer="$runner/Installer/$installerName"
$packageName="AndroidSideloader-${{ github.ref_name }}.exe"
$package="$runner/$packageName"
echo "BUILD_DIR_PATH=$build" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "ARCHIVE_NAME=$archiveName" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "ARCHIVE_PATH=$archive" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "INSTALLER_NAME=$installerName" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "INSTALLER_PATH=$installer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "PACKAGE_NAME=packageName" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "PACKAGE_PATH=$package" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Extract Release Notes
id: extract_changelog
run: |
$ReleaseNotes = & "scripts/get-release-notes.ps1" -VersionName ${{ github.ref_name }}
if ($LASTEXITCODE -ne 0) {
Write-Output "$ReleaseNotes"
exit 1
}
$ReleaseNotes | Out-File -FilePath "./ReleaseNotes.md" -Encoding utf8
- name: Install Enigma Virtual Box
id: install-enigma
run: |
choco install enigmavirtualbox -y --ignore-checksums
$enigma="C:\Program Files (x86)\Enigma Virtual Box\enigmavbconsole.exe"
echo "ENIGMA=$enigma" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Setup Flutter
uses: subosito/[email protected]
with:
channel: stable
flutter-version-file: pubspec.yaml
cache: true
- name: Install Dependencies
run: flutter pub get
- name: Build for Windows
run: flutter build windows
- name: Compile .ISS to .EXE Installer
uses: Minionguyjpro/[email protected]
with:
path: installer.iss
options: /O+ /DMyAppVersion="${{ github.ref_name }}"
- name: Create enigma package
run: |
& '${{ env.ENIGMA }}' .\package.evb -output ${{ env.PACKAGE_PATH }}
- name: Compress Build Directory
run: |
Compress-Archive -Path "${{ env.BUILD_DIR_PATH }}\*" -DestinationPath "${{ env.ARCHIVE_PATH }}"
- name: Upload Build Files
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARCHIVE_NAME }}
path: ${{ env.ARCHIVE_PATH }}
- name: Upload Installer Executable as Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.INSTALLER_NAME }}
path: ${{ env.INSTALLER_PATH }}
- name: Upload Enigma Package as Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.PACKAGE_NAME }}
path: ${{ env.PACKAGE_PATH }}
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
tag: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
bodyFile: "ReleaseNotes.md"
replacesArtifacts: true
draft: true
prerelease: true
artifactErrorsFailBuild: true
artifacts: "${{ env.ARCHIVE_PATH }},${{ env.INSTALLER_PATH }},${{ env.PACKAGE_PATH }}"