-
-
Notifications
You must be signed in to change notification settings - Fork 17
ci(build): Add Build And Release Pipeline #83
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
Open
Thogsit
wants to merge
1
commit into
avdept:main
Choose a base branch
from
Thogsit:ci/build_add_build_and_release_pipeline
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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 hidden or 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,127 @@ | ||
| name: Build and Release Flutter Desktop Apps | ||
| # Workflow based on https://medium.com/illumination-curated/setting-up-ci-cd-for-flutter-desktop-applications-1f5fb2ab0bff | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main # Always release the current main branch | ||
| workflow_dispatch: # Enable manual trigger | ||
|
|
||
| jobs: | ||
| linux: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - uses: subosito/flutter-action@v1 | ||
| with: | ||
| channel: 'stable' | ||
| - name: Install OS dependencies | ||
| run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev mpv libmpv-dev | ||
| - name: Install project dependencies | ||
| run: flutter pub get | ||
| - name: Generate intermediates | ||
| run: flutter pub run build_runner build --delete-conflicting-outputs | ||
| - name: Enable Linux build | ||
| run: flutter config --enable-linux-desktop | ||
| - name: Build artifacts | ||
| run: flutter build linux --release | ||
| - name: Package release files | ||
| uses: thedoctor0/zip-release@main | ||
| with: | ||
| type: 'zip' | ||
| filename: JellyBox-${{github.ref_name}}-linux.zip | ||
| directory: build/linux/x64/release/bundle | ||
| - name: Release to github | ||
| uses: softprops/action-gh-release@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| tag_name: ${{github.ref_name}} | ||
| files: build/linux/x64/release/bundle/JellyBox-${{github.ref_name}}-linux.zip | ||
|
|
||
| windows: | ||
| runs-on: windows-latest | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - uses: subosito/flutter-action@v1 | ||
| with: | ||
| channel: 'stable' | ||
| - name: Install project dependencies | ||
| run: flutter pub get | ||
| - name: Generate intermediates | ||
| run: flutter pub run build_runner build --delete-conflicting-outputs | ||
| - name: Enable Windows build | ||
| run: flutter config --enable-windows-desktop | ||
| - name: Build artifacts | ||
| run: flutter build windows --release | ||
| - name: Package release | ||
| uses: thedoctor0/zip-release@master | ||
| with: | ||
| type: 'zip' | ||
| filename: JellyBox-${{github.ref_name}}-windows.zip | ||
| directory: build/windows/x64/runner/Release | ||
| - name: Release to github | ||
| uses: softprops/action-gh-release@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| tag_name: ${{github.ref_name}} | ||
| files: build/windows/x64/runner/Release/JellyBox-${{github.ref_name}}-windows.zip | ||
|
|
||
| android: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Set up JDK 17 # Required for the package_info_plus flutter package | ||
| uses: actions/setup-java@v3 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
| - uses: subosito/flutter-action@v1 | ||
| with: | ||
| channel: 'stable' | ||
| - name: Install project dependencies | ||
| run: flutter pub get | ||
| - name: Generate intermediates | ||
| run: flutter pub run build_runner build --delete-conflicting-outputs | ||
| - name: Build artifacts | ||
| run: flutter build apk --release | ||
| - name: Rename out apk | ||
| run: mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/JellyBox-${{github.ref_name}}-android.apk | ||
| - name: Release to github | ||
| uses: softprops/action-gh-release@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| tag_name: ${{github.ref_name}} | ||
| files: build/app/outputs/flutter-apk/JellyBox-${{github.ref_name}}-android.apk | ||
|
|
||
| # Not working atm; set signing as described e.g. here in step 2.2) https://medium.com/@fluttergems/packaging-and-distributing-flutter-desktop-apps-the-missing-guide-part-1-macos-b36438269285 | ||
| #macos: | ||
| # runs-on: macos-latest # macOS is required for building macOS apps | ||
| # steps: | ||
| # - uses: actions/checkout@v2 | ||
| # - uses: subosito/flutter-action@v1 | ||
| # with: | ||
| # channel: 'stable' | ||
| # - name: Install project dependencies | ||
| # run: flutter pub get | ||
| # - name: Generate intermediates | ||
| # run: flutter pub run build_runner build --delete-conflicting-outputs | ||
| # - name: Enable MacOS build | ||
| # run: flutter config --enable-macos-desktop | ||
| # - name: Build artifacts | ||
| # run: flutter build macos --release | ||
| # - name: Package release | ||
| # uses: thedoctor0/zip-release@master | ||
| # with: | ||
| # type: 'zip' | ||
| # filename: JellyBox-${{github.ref_name}}-macos.zip | ||
| # directory: build/macos/Build/Products/Release | ||
| # - name: Release to github | ||
| # uses: softprops/action-gh-release@v1 | ||
| # env: | ||
| # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| # with: | ||
| # tag_name: ${{github.ref_name}} | ||
| # files: build/macos/Build/Products/Release/JellyBox-${{github.ref_name}}-macos.zip | ||
This file contains hidden or 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
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.
This one that starts with GHP_ right?