Skip to content

Commit fc94295

Browse files
authored
Merge pull request #15 from adeeteya/refactor
Refactor Entire Project
2 parents e868d31 + 7b616a0 commit fc94295

File tree

272 files changed

+8404
-2137
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

272 files changed

+8404
-2137
lines changed

.github/FUNDING.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
github: [adeeteya]
2+
buy_me_a_coffee: adeeteya
23
patreon: adeeteya
3-
ko_fi: adeeteya
44
liberapay: adeeteya
5-
custom: ['https://www.buymeacoffee.com/adeeteya','https://www.paypal.me/adityar224']
5+
ko_fi: adeeteya
6+
open_collective: adeeteya
Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
name: Build and Deploy Releases
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version_number:
7+
description: 'Release Version Number'
8+
required: true
9+
type: string
10+
android:
11+
description: 'Build Android Release'
12+
type: boolean
13+
default: true
14+
linux:
15+
description: 'Build Linux Release'
16+
type: boolean
17+
default: true
18+
windows:
19+
description: 'Build Windows Release'
20+
type: boolean
21+
default: true
22+
web:
23+
description: 'Build Web Release'
24+
type: boolean
25+
default: true
26+
27+
env:
28+
FLUTTER_CHANNEL: "stable"
29+
RUBY_VERSION: "3.2.2"
30+
31+
jobs:
32+
33+
create_github_release:
34+
name: Create GitHub Release
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v4
39+
40+
- name: Create a GitHub Release
41+
run: |
42+
if gh release view "${{ inputs.version_number }}" > /dev/null 2>&1; then
43+
echo "Release '${{ inputs.version_number }}' already exists. Skipping release creation."
44+
else
45+
echo "Release '${{ inputs.version_number }}' does not exist. Creating release..."
46+
gh release create "${{ inputs.version_number }}" --title "Version ${{ inputs.version_number }}" --generate-notes
47+
fi
48+
env:
49+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
50+
51+
build_web:
52+
if: ${{ inputs.web }}
53+
name: Build Web
54+
runs-on: ubuntu-latest
55+
steps:
56+
- uses: actions/checkout@v4
57+
58+
- name: Run Flutter tasks
59+
uses: subosito/flutter-action@v2
60+
with:
61+
flutter-version-file: 'pubspec.yaml'
62+
channel: ${{ env.FLUTTER_CHANNEL }}
63+
64+
- name: Generate Localizations
65+
run: flutter gen-l10n
66+
67+
- uses: bluefireteam/flutter-gh-pages@v9
68+
with:
69+
baseHref: /FlutterMarkdownEditor/
70+
71+
build_linux:
72+
if: ${{ inputs.linux }}
73+
name: Build Linux
74+
runs-on: ubuntu-latest
75+
timeout-minutes: 40
76+
steps:
77+
- name: Checkout
78+
uses: actions/checkout@v4
79+
80+
- name: Run Flutter tasks
81+
uses: subosito/flutter-action@v2.16.0
82+
with:
83+
flutter-version-file: 'pubspec.yaml'
84+
channel: ${{ env.FLUTTER_CHANNEL }}
85+
architecture: x64
86+
cache: true
87+
88+
- name: Install System Dependencies
89+
run: |
90+
sudo apt-get update -y && sudo apt-get upgrade -y
91+
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev libstdc++-12-dev
92+
93+
- name: Install Flutter Dependencies
94+
run: flutter pub get
95+
96+
- name: Generate Localizations
97+
run: flutter gen-l10n
98+
99+
- name: Install Fastforge
100+
run: dart pub global activate fastforge
101+
102+
- name: Install Build Dependencies
103+
run: |
104+
sudo apt-get -y install libfuse-dev locate
105+
wget -q "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" -O /usr/local/bin/appimagetool
106+
chmod +x /usr/local/bin/appimagetool
107+
sudo apt-get -y install dpkg
108+
sudo apt-get -y install patchelf rpm
109+
110+
- name: Build and release
111+
run: fastforge release --name production
112+
113+
- name: "Publish Linux Release"
114+
env:
115+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
116+
run: |
117+
REL_VER=$(grep "^version" pubspec.yaml | cut -d' ' -f2)
118+
for PKG in AppImage deb rpm; do
119+
mv "dist/${REL_VER}/markdown_editor-${REL_VER}-linux.${PKG}" "MarkdownEditor-Linux-${PKG}.${PKG}"
120+
gh release upload ${{ inputs.version_number }} "MarkdownEditor-Linux-${PKG}.${PKG}" --clobber
121+
done
122+
123+
build_windows:
124+
if: ${{ inputs.windows }}
125+
name: Build Windows
126+
runs-on: windows-latest
127+
steps:
128+
- uses: actions/checkout@v4
129+
130+
- name: Install yq
131+
run: choco install yq
132+
133+
- name: Run Flutter tasks
134+
uses: subosito/flutter-action@v2
135+
with:
136+
flutter-version-file: 'pubspec.yaml'
137+
channel: ${{ env.FLUTTER_CHANNEL }}
138+
139+
- name: Generate Localizations
140+
run: flutter gen-l10n
141+
142+
- name: Build Windows Release
143+
run: flutter build windows --release
144+
145+
- name: Install Inno Setup
146+
run: |
147+
Invoke-WebRequest -Uri http://files.jrsoftware.org/is/6/innosetup-6.4.2.exe -OutFile build\installer.exe
148+
git clone https://github.com/DomGries/InnoDependencyInstaller.git build\inno-depend
149+
Start-Process -Wait -FilePath build\installer.exe -ArgumentList '/verysilent', '/allusers', '/dir=build\iscc'
150+
151+
- name: Run Inno Setup to Build Installer
152+
run: |
153+
build\iscc\iscc.exe scripts\windows-setup.iss /DMyAppVersion=${{ inputs.version_number }}
154+
155+
- name: Upload Windows Release Artifact to GitHub Release
156+
shell: cmd
157+
run: |
158+
gh release upload ${{ inputs.version_number }} C:\a\FlutterMarkdownEditor\FlutterMarkdownEditor\MarkdownEditor-Windows.exe
159+
env:
160+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
161+
162+
build_android:
163+
if: ${{ inputs.android }}
164+
name: Build Android
165+
runs-on: ubuntu-latest
166+
timeout-minutes: 40
167+
steps:
168+
- name: Checkout
169+
uses: actions/checkout@v4
170+
171+
- name: Set up Ruby
172+
uses: ruby/setup-ruby@v1
173+
with:
174+
ruby-version: ${{ env.RUBY_VERSION }}
175+
bundler-cache: true
176+
working-directory: 'android'
177+
178+
- name: Run Flutter tasks
179+
uses: subosito/flutter-action@v2.16.0
180+
with:
181+
flutter-version-file: 'pubspec.yaml'
182+
channel: ${{ env.FLUTTER_CHANNEL }}
183+
cache: true
184+
185+
- name: Create google_service_account.json
186+
run: |
187+
echo "${{ secrets.FIREBASE_SERVICE_ACCOUNT_BASE64 }}" | base64 --decode > google_service_account.json
188+
189+
- name: Create key.jks
190+
run: |
191+
echo "${{ secrets.ANDROID_KEYSTORE_FILE_BASE64 }}" | base64 --decode > android/key.jks
192+
193+
- name: Create key.properties
194+
run: |
195+
cat <<EOF > android/key.properties
196+
storePassword=${{ secrets.ANDROID_KEY_STORE_PASSWORD }}
197+
keyPassword=${{ secrets.ANDROID_KEY_STORE_PASSWORD }}
198+
keyAlias=release
199+
storeFile=../key.jks
200+
EOF
201+
env:
202+
ANDROID_KEY_STORE_PASSWORD: ${{ secrets.ANDROID_KEY_STORE_PASSWORD }}
203+
204+
- name: Release To Play Store
205+
uses: maierj/fastlane-action@v3.1.0
206+
with:
207+
lane: 'release_play_store'
208+
subdirectory: android
209+
options: '{ "version_number": "${{ inputs.version_number }}" }'
210+
env:
211+
APP_PACKAGE_NAME: ${{ secrets.APP_PACKAGE_NAME }}
212+
213+
- name: Build APK
214+
uses: maierj/fastlane-action@v3.1.0
215+
with:
216+
lane: 'build_apk'
217+
subdirectory: android
218+
options: '{ "version_number": "${{ inputs.version_number }}" }'
219+
220+
- name: Upload APK Artifact to GitHub Release
221+
run: gh release upload ${{ inputs.version_number }} build/app/outputs/flutter-apk/MarkdownEditor-Android.apk
222+
env:
223+
GH_TOKEN: ${{ secrets.GH_TOKEN }}

.github/workflows/pr-checker.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Lint Checking on PR
2+
3+
on:
4+
pull_request:
5+
6+
env:
7+
FLUTTER_VERSION: 3.32.4
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
ref: ${{ github.event.pull_request.head.sha }}
16+
- uses: subosito/flutter-action@v2
17+
with:
18+
flutter-version: ${{ env.FLUTTER_VERSION }}
19+
20+
- name: Configure repo
21+
run: |
22+
flutter pub get
23+
flutter gen-l10n
24+
25+
- name: Lint Dart files
26+
run: |
27+
dart analyze --no-fatal-warnings

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,5 @@ google_service_account.json
5050
**/fastlane/report.xml
5151
**/fastlane/Preview.html
5252
**/fastlane/screenshots
53-
**/fastlane/test_output
53+
**/fastlane/test_output
54+
/lib/l10n/generated/

0 commit comments

Comments
 (0)