-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add github pages and build workflows
- Loading branch information
Showing
2 changed files
with
173 additions
and
0 deletions.
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,118 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
name: Open Work Build | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
|
||
jobs: | ||
build-apk-appbundle: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
channel: "stable" | ||
|
||
- name: Set up Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: "zulu" | ||
java-version: "17" | ||
|
||
- name: Install Flutter packages | ||
run: flutter pub get | ||
|
||
- name: Run tests | ||
run: flutter test -r expanded | ||
|
||
- name: Build apk | ||
run: flutter build apk | ||
|
||
- name: Build appbundle | ||
run: flutter build appbundle | ||
|
||
- name: Upload apk to release | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: release-apk | ||
path: build/app/outputs/flutter-apk/app-release.apk | ||
|
||
- name: Upload aab to release | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: release-aab | ||
path: build/app/outputs/bundle/release/app-release.aab | ||
|
||
build-windows: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
channel: stable | ||
|
||
- name: Install Flutter packages | ||
run: flutter pub get | ||
|
||
- name: Run tests | ||
run: flutter test -r expanded | ||
|
||
- name: Build windows | ||
run: flutter build windows | ||
|
||
- name: Upload windows to release | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: release-windows | ||
path: build/windows/x64/runner/Release/ | ||
|
||
build-linux: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
channel: stable | ||
|
||
- name: Set up Linux | ||
run: | | ||
sudo apt-get update -y | ||
sudo apt-get install -y ninja-build libgtk-3-dev | ||
- name: Install Flutter packages | ||
run: flutter pub get | ||
|
||
- name: Run tests | ||
run: flutter test -r expanded | ||
|
||
- name: Build Linux | ||
run: flutter build linux | ||
|
||
- name: Upload linux to release | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: release-linux | ||
path: build/linux/x64/release/bundle/ | ||
|
||
download: | ||
runs-on: ubuntu-latest | ||
needs: [build-apk-appbundle, build-windows, build-linux] | ||
steps: | ||
- name: Download All Artifacts | ||
uses: actions/download-artifact@v4 | ||
- name: Display structure of downloaded files | ||
run: ls -R |
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,55 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: Deploy Github Pages | ||
|
||
# Controls when the workflow will run | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the "main" branch | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Flutter | ||
uses: subosito/flutter-action@v2 | ||
|
||
- run: flutter --version | ||
|
||
- name: Install Flutter packages | ||
run: flutter pub get | ||
|
||
- name: Run tests | ||
run: flutter test -r expanded | ||
|
||
- name: Build | ||
run: flutter build web --base-href "/open_work/" --release | ||
|
||
- name: Setup Pages | ||
uses: actions/configure-pages@v5 | ||
|
||
- name: Upload Artifacts | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: "./build/web" | ||
|
||
- name: Deploy | ||
uses: actions/deploy-pages@v4 |