Skip to content

Commit

Permalink
feat: add github pages and build workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
sipasi committed Aug 9, 2024
1 parent c7d8a5a commit 4fe7600
Show file tree
Hide file tree
Showing 2 changed files with 173 additions and 0 deletions.
118 changes: 118 additions & 0 deletions .github/workflows/build.yml
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
55 changes: 55 additions & 0 deletions .github/workflows/deploy-github-pages.yml
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

0 comments on commit 4fe7600

Please sign in to comment.