Skip to content

Commit 0039c45

Browse files
Initial commit with auto-deploy & auto-release then update version
0 parents  commit 0039c45

File tree

165 files changed

+5230
-0
lines changed

Some content is hidden

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

165 files changed

+5230
-0
lines changed

.fvmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"flutter": "3.29.0"
3+
}

.github/workflows/deploy.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Deploy Flutter Web App to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
with:
15+
persist-credentials: false
16+
17+
- name: Set up Flutter
18+
uses: subosito/flutter-action@v2
19+
with:
20+
channel: stable
21+
flutter-version-file: pubspec.yaml
22+
23+
- name: Get dependencies
24+
run: flutter pub get
25+
26+
- name: Build Flutter Web
27+
run: |
28+
REPO_NAME=$(basename $GITHUB_REPOSITORY)
29+
flutter build web --release --base-href="/$REPO_NAME/"
30+
31+
- name: Deploy to GitHub Pages
32+
uses: peaceiris/actions-gh-pages@v4
33+
with:
34+
github_token: ${{ secrets.GITHUB_TOKEN }}
35+
publish_dir: build/web

.github/workflows/release.yml

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
name: Create GitHub Cross-Platform Release on Tag
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Trigger on tags like v1.0.0+1
7+
8+
jobs:
9+
build-linux:
10+
name: Build Web + Android (Ubuntu)
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Flutter
17+
uses: subosito/flutter-action@v2
18+
with:
19+
channel: stable
20+
flutter-version-file: pubspec.yaml
21+
22+
- name: Install dependencies
23+
run: flutter pub get
24+
25+
- name: Build Web
26+
run: |
27+
flutter build web --release
28+
sudo apt-get update
29+
sudo apt-get install -y p7zip-full
30+
7z a web-release.7z build/web
31+
32+
- name: Build APK
33+
run: |
34+
flutter build apk --release
35+
cp build/app/outputs/flutter-apk/app-release.apk ./app-release.apk
36+
37+
- name: Rename artifacts with version
38+
run: |
39+
VERSION=${{ github.ref_name }}
40+
mv web-release.7z web-release-$VERSION.7z
41+
mv app-release.apk app-release-$VERSION.apk
42+
43+
- name: Upload Artifacts
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: linux-artifacts
47+
path: |
48+
web-release-${{ github.ref_name }}.7z
49+
app-release-${{ github.ref_name }}.apk
50+
51+
build-windows:
52+
name: Build Windows
53+
runs-on: windows-latest
54+
steps:
55+
- uses: actions/checkout@v4
56+
57+
- uses: subosito/flutter-action@v2
58+
with:
59+
channel: stable
60+
flutter-version-file: pubspec.yaml
61+
62+
- name: Install dependencies
63+
run: flutter pub get
64+
65+
- name: Build Windows
66+
run: |
67+
flutter build windows --release
68+
& "C:\Program Files\7-Zip\7z.exe" a windows-release.7z build/windows/x64/runner/Release/*
69+
70+
- name: Rename Windows artifact with version
71+
run: |
72+
$version = "${{ github.ref_name }}"
73+
Rename-Item -Path "windows-release.7z" -NewName "windows-release-$version.7z"
74+
75+
- name: Upload Artifacts
76+
uses: actions/upload-artifact@v4
77+
with:
78+
name: windows-artifacts
79+
path: windows-release-${{ github.ref_name }}.7z
80+
81+
release:
82+
name: Publish GitHub Release and Modify README.md
83+
needs: [build-linux, build-windows]
84+
runs-on: ubuntu-latest
85+
steps:
86+
- name: Download all artifacts
87+
uses: actions/download-artifact@v4
88+
with:
89+
path: artifacts
90+
91+
- name: Upload to GitHub Release
92+
uses: softprops/action-gh-release@v2
93+
with:
94+
name: Release ${{ github.ref_name }}
95+
tag_name: ${{ github.ref_name }}
96+
generate_release_notes: true
97+
files: |
98+
artifacts/linux-artifacts/*
99+
artifacts/windows-artifacts/*
100+
env:
101+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
102+
103+
# Modify version placeholders in README.md
104+
- name: Checkout repository
105+
uses: actions/checkout@v4
106+
with:
107+
ref: main # or your default branch
108+
109+
- name: Set up environment variables
110+
run: |
111+
echo "VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
112+
echo "ENCODED_VERSION=$(echo "${GITHUB_REF##*/}" | sed 's/+/%2B/g')" >> $GITHUB_ENV
113+
114+
- name: Set up Git
115+
run: |
116+
git config user.name "github-actions[bot]"
117+
git config user.email "github-actions[bot]@users.noreply.github.com"
118+
119+
- name: Replace version placeholders in README.md
120+
run: |
121+
sed -i "s/{{VERSION}}/$VERSION/g" README.md
122+
sed -i "s/{{ENCODED_VERSION}}/$ENCODED_VERSION/g" README.md
123+
124+
- name: Commit and push README update
125+
run: |
126+
git add README.md
127+
git commit -m "Update README with release version $VERSION"
128+
git push origin HEAD

.gitignore

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.build/
9+
.buildlog/
10+
.history
11+
.svn/
12+
.swiftpm/
13+
migrate_working_dir/
14+
15+
# IntelliJ related
16+
*.iml
17+
*.ipr
18+
*.iws
19+
.idea/
20+
21+
# The .vscode folder contains launch configuration and tasks you configure in
22+
# VS Code which you may wish to be included in version control, so this line
23+
# is commented out by default.
24+
#.vscode/
25+
26+
# Flutter/Dart/Pub related
27+
**/doc/api/
28+
**/ios/Flutter/.last_build_id
29+
.dart_tool/
30+
.flutter-plugins
31+
.flutter-plugins-dependencies
32+
.pub-cache/
33+
.pub/
34+
/build/
35+
build/*
36+
!build/web/
37+
flutter_export_environment.sh
38+
39+
# Symbolication related
40+
app.*.symbols
41+
42+
# Obfuscation related
43+
app.*.map.json
44+
45+
# Android Studio will place build artifacts here
46+
/android/app/debug
47+
/android/app/profile
48+
/android/app/release
49+
50+
# Files and directories created by pub
51+
.packages
52+
build/
53+
# If you're building an application, you may want to check-in your pubspec.lock
54+
pubspec.lock
55+
56+
# Directory created by dartdoc
57+
# If you don't generate documentation locally you can remove this line.
58+
doc/api/
59+
60+
# dotenv environment variables file
61+
.env*
62+
63+
# Avoid committing generated Javascript files:
64+
*.dart.js
65+
*.info.json # Produced by the --dump-info flag.
66+
*.js # When generated by dart2js. Don't specify *.js if your
67+
# project includes source files written in JavaScript.
68+
*.js_
69+
*.js.deps
70+
*.js.map
71+
72+
# Android specific
73+
android/.gradle/
74+
android/app/debug
75+
android/app/profile
76+
android/app/release
77+
android/build/
78+
79+
# iOS specific
80+
ios/Flutter/Flutter.framework
81+
ios/Flutter/App.framework
82+
ios/Flutter/Generated.xcconfig
83+
84+
# for fvm setup
85+
.fvm/

.metadata

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: "35c388afb57ef061d06a39b537336c87e0e3d1b1"
8+
channel: "stable"
9+
10+
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
17+
base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
18+
- platform: android
19+
create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
20+
base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
21+
- platform: ios
22+
create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
23+
base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
24+
- platform: linux
25+
create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
26+
base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
27+
- platform: macos
28+
create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
29+
base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
30+
- platform: web
31+
create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
32+
base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
33+
- platform: windows
34+
create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
35+
base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
36+
37+
# User provided section
38+
39+
# List of Local paths (relative to this file) that should be
40+
# ignored by the migrate tool.
41+
#
42+
# Files that are not part of the templates will be ignored by default.
43+
unmanaged_files:
44+
- 'lib/main.dart'
45+
- 'ios/Runner.xcodeproj/project.pbxproj'

0 commit comments

Comments
 (0)