Skip to content

Commit 906355f

Browse files
committed
chore: made some changes to release and dev workflow
- added app sign for android - added windows installer building - separated MacOS and IOS ** Still need to make them release ** ** Check weather change logs is working ** ** Still not ready for a Release **
1 parent c21aa99 commit 906355f

File tree

2 files changed

+136
-58
lines changed

2 files changed

+136
-58
lines changed

.github/workflows/dart.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,6 @@ jobs:
247247
filename: Dantotsu_Linux_${{github.ref_name}}.zip
248248
directory: build/linux/x64/release/bundle
249249

250-
# Step 8: Verify archive creation
251-
- name: List Release Directory
252-
run: ls build/linux/x64/release/bundle
253-
shell: pwsh
254-
255250
# Step 9: Upload to Google Drive
256251
- name: Upload File To Google Drive
257252
id: gdriveUpload

.github/workflows/release.yml

Lines changed: 136 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,46 @@ jobs:
1414
steps:
1515
- uses: actions/setup-java@v4
1616
with:
17-
distribution: 'oracle'
18-
java-version: '17'
17+
distribution: "oracle"
18+
java-version: "17"
1919
- name: Cloing repository
2020
uses: actions/checkout@v4
2121
- name: Setup Flutter
2222
uses: subosito/flutter-action@v2
2323
with:
24-
flutter-version: 3.24.1
24+
flutter-version: 3.27.1
25+
cache: true
26+
27+
# Download the keystore file (from GitHub Secrets or other storage)
28+
- name: Download keystore
29+
env:
30+
KEYSTORE_BASE64: ${{ secrets.APK_SIGN }}
31+
run: echo "$KEYSTORE_BASE64" | base64 --decode > android/app/dartotsu.jks
32+
# Set up environment variables for signing
33+
- name: Set up signing variables
34+
env:
35+
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
36+
KEY_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
37+
KEY_ALIAS: ${{ secrets.KEY_ALIAS}}
38+
run: |
39+
echo "storePassword=$KEYSTORE_PASSWORD" > android/key.properties
40+
echo "keyPassword=$KEY_PASSWORD" >> android/key.properties
41+
echo "keyAlias=$KEY_ALIAS" >> android/key.properties
42+
echo "storeFile=dartotsu.jks" >> android/key.properties
43+
# Optimize Flutter build
2544
- run: flutter pub get
26-
- run: flutter build apk
27-
- run: mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/Dantotsu_Android_${{github.ref_name}}.apk
28-
- name: Android Apk Release
29-
uses: softprops/action-gh-release@master
30-
with:
31-
files: build/app/outputs/flutter-apk/Dantotsu_Android_${{github.ref_name}}.apk
45+
- run: flutter build apk --release --split-per-abi
46+
- name: Rename APKs
47+
run: |
48+
for file in build/app/outputs/flutter-apk/app-*-release.apk; do
49+
abi=$(basename $file | sed 's/app-\(.*\)-release.apk/\1/')
50+
mv $file build/app/outputs/flutter-apk/Dartotsu_Android_${abi}_${{github.ref_name}}.apk
51+
done
52+
ls build/app/outputs/flutter-apk
53+
# - name: Android Apk Release
54+
# uses: softprops/action-gh-release@master
55+
# with:
56+
# files: build/app/outputs/flutter-apk/Dantotsu_Android_${{github.ref_name}}.apk
3257
build_windows:
3358
runs-on: windows-latest
3459
permissions:
@@ -38,23 +63,37 @@ jobs:
3863
steps:
3964
- name: Cloing repository
4065
uses: actions/checkout@v4
66+
# This is a self made cert file that is used to sign the windows app
67+
- name: Set up Signing Tool
68+
run: |
69+
mkdir $env:USERPROFILE\certs
70+
[System.IO.File]::WriteAllBytes("$env:USERPROFILE\certs\Dartotsu.pfx", [Convert]::FromBase64String("${{secrets.PFX_FILE}}"))
71+
# Setup Flutter with caching
4172
- name: Setup Flutter
4273
uses: subosito/flutter-action@v2
4374
with:
44-
flutter-version: 3.24.1
75+
flutter-version: 3.27.1
76+
cache: true
77+
# Enable Windows desktop support
78+
- name: Enable Windows desktop support
79+
run: flutter config --enable-windows-desktop
80+
# Get dependencies with cached packages
4581
- run: flutter pub get
46-
- run: flutter build windows
47-
- name: Archive App
48-
uses: thedoctor0/zip-release@master
49-
with:
50-
type: 'zip'
51-
filename: Dantotsu_Windows_${{github.ref_name}}.zip
52-
directory: build\windows\x64\runner\Release
53-
- run: ls build\windows\x64\runner\Release
54-
- name: Release Windows Zip
55-
uses: softprops/action-gh-release@master
56-
with:
57-
files: build/windows/x64/runner/Release/Dantotsu_Windows_${{github.ref_name}}.zip
82+
# Extract version from pubspec.yaml
83+
- name: Extract Version
84+
id: get_version
85+
run: |
86+
$version = (Get-Content pubspec.yaml | Select-String -Pattern 'version: ([\d.]+)').Matches.Groups[1].Value
87+
echo "version=$version" >> $env:GITHUB_ENV
88+
89+
- name: Build and Sign Setup
90+
run: |
91+
dart run inno_bundle:build --sign-tool-params '"C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /fd sha256 /f "C:\Users\runneradmin\certs\Dartotsu.pfx" /p "${{secrets.PFX_PASSWORD}}" /t http://timestamp.digicert.com /v $f' --release
92+
- run: build\windows\x64\installer\Release
93+
# - name: Release Windows Zip
94+
# uses: softprops/action-gh-release@master
95+
# with:
96+
# files: build/windows/x64/runner/Release/Dantotsu_Windows_${{github.ref_name}}.zip
5897

5998

6099
build_linux:
@@ -64,60 +103,104 @@ jobs:
64103
pull-requests: write
65104
repository-projects: write
66105
steps:
67-
- name: Cloing repository
106+
# Step 1: Clone repository
107+
- name: Cloning repository
68108
uses: actions/checkout@v4
109+
110+
# Step 2: Setup Flutter
69111
- name: Setup Flutter
70112
uses: subosito/flutter-action@v2
71113
with:
72-
flutter-version: 3.24.1
73-
- run: |
114+
flutter-version: 3.27.1
115+
cache: true
116+
117+
# Step 3: Setup system dependencies
118+
- name: Install system dependencies
119+
run: |
74120
sudo apt-get update -y
75121
sudo apt-get install -y ninja-build libgtk-3-dev webkit2gtk-4.1
76-
- run: flutter pub get
77-
- run: flutter build linux
122+
# Step 5: Fetch Flutter dependencies
123+
- name: Fetch Flutter dependencies
124+
run: flutter pub get
125+
# Step 6: Build the Linux application
126+
- name: Build Flutter Linux app
127+
run: flutter build linux
128+
# Step 7: Archive the Linux app
78129
- name: Archive app
79130
uses: thedoctor0/zip-release@master
80131
with:
81132
type: 'zip'
82133
filename: Dantotsu_Linux_${{github.ref_name}}.zip
83134
directory: build/linux/x64/release/bundle
84-
- name: Release Linux Zip
85-
uses: softprops/action-gh-release@master
86-
with:
87-
files: build/linux/x64/release/bundle/Dantotsu_Linux_${{github.ref_name}}.zip
88-
build_ios_and_macos:
89-
runs-on: macos-13
135+
# - name: Release Linux Zip
136+
# uses: softprops/action-gh-release@master
137+
# with:
138+
# files: build/linux/x64/release/bundle/Dantotsu_Linux_${{github.ref_name}}.zip
139+
build_ios:
140+
runs-on: macos-latest
90141
permissions:
91142
contents: write
92143
pull-requests: write
93144
repository-projects: write
94145
steps:
95-
- name: Cloing repository
146+
# Step 1: Clone repository
147+
- name: Cloning repository
96148
uses: actions/checkout@v4
149+
150+
# Step 2: Setup Flutter
97151
- name: Setup Flutter
98152
uses: subosito/flutter-action@v2
99153
with:
100-
flutter-version: 3.24.1
101-
- run: flutter pub get
102-
- run: flutter build ios --release --no-codesign
103-
- name: Release ios App
104-
uses: softprops/action-gh-release@master
105-
with:
106-
files: build/ios/iphoneos/Runner.app
107-
- run: flutter build macos
108-
- name: Archive App
109-
uses: thedoctor0/zip-release@master
110-
with:
111-
type: 'zip'
112-
filename: Dantotsu_MacOS_${{github.ref_name}}.zip
113-
directory: build/macos/Build/Products/Release
114-
- name: Release MacOS Zip
115-
uses: softprops/action-gh-release@master
154+
flutter-version: 3.27.1
155+
cache: true
156+
157+
# Step 3 Get Dependencies
158+
- name: Get Dependencies
159+
run: flutter pub get
160+
#Step 4 Build app for iOS
161+
- name: Build iOS
162+
run: |
163+
flutter build ios --release --no-codesign
164+
cd build/ios/iphoneos
165+
mkdir -p Payload
166+
cd Payload
167+
ln -s ../Runner.app
168+
cd ..
169+
zip -r Dartotsu-iOS-${{ github.ref_name }}.ipa Payload
170+
build_macos:
171+
runs-on: macos-latest
172+
permissions:
173+
contents: write
174+
pull-requests: write
175+
repository-projects: write
176+
steps:
177+
# Step 1: Clone repository
178+
- name: Cloning repository
179+
uses: actions/checkout@v4
180+
181+
# Step 2: Setup Flutter
182+
- name: Setup Flutter
183+
uses: subosito/flutter-action@v2
116184
with:
117-
files: build/macos/Build/Products/Release/Dantotsu_MacOS_${{github.ref_name}}.zip
185+
flutter-version: 3.27.1
186+
cache: true
187+
188+
# Step 3 Get Dependencies
189+
- name: Get Dependencies
190+
run: flutter pub get
191+
#Step 4 Build app for iOS
192+
- name: Build macOS
193+
run: flutter build macos --release
194+
# - name: Release macOS Zip
195+
# uses: softprops/action-gh-release@master
196+
# with:
197+
# files: build/macos/Build/Products/Release/Dantotsu_MacOS_${{github.ref_name}}.zip
198+
199+
200+
118201
upload_download_url:
119202
runs-on: ubuntu-latest
120-
needs: [build_android,build_windows,build_linux,build_ios_and_macos]
203+
needs: [build_android,build_windows,build_linux,build_ios,build_macos]
121204
steps:
122205
- name: Checkout code
123206
uses: actions/checkout@v3
@@ -180,7 +263,7 @@ jobs:
180263
181264
generate-changelog:
182265
runs-on: ubuntu-latest
183-
needs: [build_android,build_windows,build_linux,build_ios_and_macos]
266+
needs: [build_android,build_windows,build_linux,build_ios,build_macos]
184267
steps:
185268
- name: Checkout Code
186269
uses: actions/checkout@v4

0 commit comments

Comments
 (0)