-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: ci/cd Integration for Automated Release Builds and Notifications #50
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
65169c6
feat: ci/cd Integration for Automated Release Builds and Notifications
phoenixit99 a4cff4b
fix: set flutter version to `3.24.5` on ci/cd release configuration
esmaeil-ahmadipour 8438901
update: update `CHANGELOG.md` & `pubspec.yaml` files
esmaeil-ahmadipour File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,324 @@ | ||
name: Desktop Release Build | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: read | ||
|
||
on: | ||
pull_request_target: | ||
types: [closed] | ||
branches: [ "develop" ] | ||
|
||
jobs: | ||
build-and-release-linux: | ||
if: github.event.pull_request.merged == true | ||
runs-on: ubuntu-latest | ||
outputs: | ||
release_tag: linux-release-${{ github.run_number }} | ||
platform: Linux | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: '3.24.5' | ||
channel: 'stable' | ||
cache: true | ||
|
||
- name: Install Linux dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y ninja-build libgtk-3-dev | ||
sudo apt-get install -y cmake pkg-config | ||
sudo apt-get install -y libblkid-dev | ||
sudo apt-get install -y liblzma-dev | ||
|
||
- name: Enable Linux desktop | ||
run: flutter config --enable-linux-desktop | ||
|
||
- name: Get dependencies | ||
run: flutter pub get | ||
|
||
- name: Build application | ||
run: flutter build linux --release | ||
|
||
- name: Archive Release | ||
uses: thedoctor0/zip-release@master | ||
with: | ||
type: 'zip' | ||
filename: 'linux-build.zip' | ||
directory: build/linux/x64/release/bundle | ||
|
||
- name: Create Linux Release | ||
id: create_linux_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: linux-release-${{ github.run_number }} | ||
release_name: Linux Release ${{ github.run_number }} | ||
body: | | ||
Linux release from merged PR #${{ github.event.pull_request.number }} | ||
${{ github.event.pull_request.title }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload Linux Release Asset | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: linux-release-${{ github.run_number }} | ||
files: build/linux/x64/release/bundle/linux-build.zip | ||
|
||
notify-linux: | ||
needs: build-and-release-linux | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Send Telegram Notification | ||
uses: appleboy/telegram-action@master | ||
with: | ||
to: ${{ secrets.TELEGRAM_CHAT_ID }} | ||
token: ${{ secrets.TELEGRAM_BOT_TOKEN }} | ||
format: markdown | ||
message: | | ||
🚀 *Linux Release Published!* | ||
|
||
📦 Version: Linux Release ${{ github.run_number }} | ||
🔄 PR: #${{ github.event.pull_request.number }} - ${{ github.event.pull_request.title }} | ||
👤 Requested by: ${{ github.event.pull_request.user.login }} | ||
✅ Merged by: ${{ github.event.pull_request.merged_by.login }} | ||
|
||
📥 *Download Link:* | ||
[Linux Build](https://github.com/${{ github.repository }}/releases/download/linux-release-${{ github.run_number }}/linux-build.zip) | ||
|
||
🔍 [View Release](https://github.com/${{ github.repository }}/releases/tag/linux-release-${{ github.run_number }}) | ||
|
||
- name: Send Discord Notification | ||
uses: Ilshidur/action-discord@master | ||
env: | ||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | ||
with: | ||
args: | | ||
🚀 **Linux Release Published!** | ||
|
||
📦 Version: Linux Release ${{ github.run_number }} | ||
🔄 PR: #${{ github.event.pull_request.number }} - ${{ github.event.pull_request.title }} | ||
👤 Requested by: ${{ github.event.pull_request.user.login }} | ||
✅ Merged by: ${{ github.event.pull_request.merged_by.login }} | ||
|
||
📥 *Download Link:* | ||
[Linux Build](https://github.com/${{ github.repository }}/releases/download/linux-release-${{ github.run_number }}/linux-build.zip) | ||
|
||
🔍 [View Release](https://github.com/${{ github.repository }}/releases/tag/linux-release-${{ github.run_number }}) | ||
|
||
build-and-release-windows: | ||
if: github.event.pull_request.merged == true | ||
runs-on: windows-latest | ||
outputs: | ||
release_tag: windows-release-${{ github.run_number }} | ||
platform: Windows | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: '3.24.5' | ||
channel: 'stable' | ||
cache: true | ||
|
||
- name: Enable Windows desktop | ||
run: flutter config --enable-windows-desktop | ||
|
||
- name: Get dependencies | ||
run: flutter pub get | ||
|
||
- name: Build application | ||
run: | | ||
flutter doctor -v | ||
flutter build windows --release | ||
dir build\windows\x64\runner\Release | ||
|
||
- name: Verify build directory | ||
run: | | ||
if (Test-Path "build\windows\x64\runner\Release") { | ||
echo "✓ Build directory exists" | ||
dir build\windows\x64\runner\Release | ||
} else { | ||
echo "× Build directory not found" | ||
exit 1 | ||
} | ||
|
||
- name: Archive Release | ||
shell: bash | ||
run: | | ||
cd build/windows/x64/runner/Release | ||
7z a -tzip windows-build.zip ./* | ||
|
||
- name: Create Windows Release | ||
id: create_windows_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: windows-release-${{ github.run_number }} | ||
release_name: Windows Release ${{ github.run_number }} | ||
body: | | ||
Windows release from merged PR #${{ github.event.pull_request.number }} | ||
${{ github.event.pull_request.title }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload Windows Release Asset | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: windows-release-${{ github.run_number }} | ||
files: build/windows/x64/runner/Release/windows-build.zip | ||
|
||
notify-windows: | ||
needs: build-and-release-windows | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Send Telegram Notification | ||
uses: appleboy/telegram-action@master | ||
with: | ||
to: ${{ secrets.TELEGRAM_CHAT_ID }} | ||
token: ${{ secrets.TELEGRAM_BOT_TOKEN }} | ||
format: markdown | ||
message: | | ||
🚀 *Windows Release Published!* | ||
|
||
📦 Version: Windows Release ${{ github.run_number }} | ||
🔄 PR: #${{ github.event.pull_request.number }} - ${{ github.event.pull_request.title }} | ||
👤 Requested by: ${{ github.event.pull_request.user.login }} | ||
✅ Merged by: ${{ github.event.pull_request.merged_by.login }} | ||
|
||
📥 *Download Link:* | ||
[Windows Build](https://github.com/${{ github.repository }}/releases/download/windows-release-${{ github.run_number }}/windows-build.zip) | ||
|
||
🔍 [View Release](https://github.com/${{ github.repository }}/releases/tag/windows-release-${{ github.run_number }}) | ||
|
||
- name: Send Discord Notification | ||
uses: Ilshidur/action-discord@master | ||
env: | ||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | ||
with: | ||
args: | | ||
🚀 **Windows Release Published!** | ||
|
||
📦 Version: Windows Release ${{ github.run_number }} | ||
🔄 PR: #${{ github.event.pull_request.number }} - ${{ github.event.pull_request.title }} | ||
👤 Requested by: ${{ github.event.pull_request.user.login }} | ||
✅ Merged by: ${{ github.event.pull_request.merged_by.login }} | ||
|
||
📥 *Download Link:* | ||
[Windows Build](https://github.com/${{ github.repository }}/releases/download/windows-release-${{ github.run_number }}/windows-build.zip) | ||
|
||
🔍 [View Release](https://github.com/${{ github.repository }}/releases/tag/windows-release-${{ github.run_number }}) | ||
|
||
build-and-release-macos: | ||
if: github.event.pull_request.merged == true | ||
runs-on: macos-latest | ||
outputs: | ||
release_tag: macos-release-${{ github.run_number }} | ||
platform: macOS | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: '3.24.5' | ||
channel: 'stable' | ||
cache: true | ||
|
||
- name: Enable macOS desktop | ||
run: flutter config --enable-macos-desktop | ||
|
||
- name: Get dependencies | ||
run: flutter pub get | ||
|
||
- name: Build application | ||
run: | | ||
flutter doctor -v | ||
flutter build macos --release | ||
ls build/macos/Build/Products/Release | ||
|
||
- name: Verify build directory | ||
run: | | ||
if [ -d "build/macos/Build/Products/Release" ]; then | ||
echo "✓ Build directory exists" | ||
ls -la build/macos/Build/Products/Release | ||
else | ||
echo "× Build directory not found" | ||
exit 1 | ||
fi | ||
|
||
- name: Archive Release | ||
run: | | ||
cd build/macos/Build/Products/Release | ||
zip -r macos-build.zip *.app | ||
|
||
- name: Create macOS Release | ||
id: create_macos_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: macos-release-${{ github.run_number }} | ||
release_name: macOS Release ${{ github.run_number }} | ||
body: | | ||
macOS release from merged PR #${{ github.event.pull_request.number }} | ||
${{ github.event.pull_request.title }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload macOS Release Asset | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: macos-release-${{ github.run_number }} | ||
files: build/macos/Build/Products/Release/macos-build.zip | ||
|
||
notify-macos: | ||
needs: build-and-release-macos | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Send Telegram Notification | ||
uses: appleboy/telegram-action@master | ||
with: | ||
to: ${{ secrets.TELEGRAM_CHAT_ID }} | ||
token: ${{ secrets.TELEGRAM_BOT_TOKEN }} | ||
format: markdown | ||
message: | | ||
🚀 *macOS Release Published!* | ||
|
||
📦 Version: macOS Release ${{ github.run_number }} | ||
🔄 PR: #${{ github.event.pull_request.number }} - ${{ github.event.pull_request.title }} | ||
👤 Requested by: ${{ github.event.pull_request.user.login }} | ||
✅ Merged by: ${{ github.event.pull_request.merged_by.login }} | ||
|
||
📥 *Download Link:* | ||
[macOS Build](https://github.com/${{ github.repository }}/releases/download/macos-release-${{ github.run_number }}/macos-build.zip) | ||
|
||
🔍 [View Release](https://github.com/${{ github.repository }}/releases/tag/macos-release-${{ github.run_number }}) | ||
|
||
- name: Send Discord Notification | ||
uses: Ilshidur/action-discord@master | ||
env: | ||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | ||
with: | ||
args: | | ||
🚀 **macOS Release Published!** | ||
|
||
📦 Version: macOS Release ${{ github.run_number }} | ||
🔄 PR: #${{ github.event.pull_request.number }} - ${{ github.event.pull_request.title }} | ||
👤 Requested by: ${{ github.event.pull_request.user.login }} | ||
✅ Merged by: ${{ github.event.pull_request.merged_by.login }} | ||
|
||
📥 *Download Link:* | ||
[macOS Build](https://github.com/${{ github.repository }}/releases/download/macos-release-${{ github.run_number }}/macos-build.zip) | ||
|
||
🔍 [View Release](https://github.com/${{ github.repository }}/releases/tag/macos-release-${{ github.run_number }}) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel you can use
3.24
and not mention the patch.