Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 34 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:

env:
FLUTTER_VERSION: '3.38.5'
PAPYRUS_API_BASE_URL: ${{ vars.PAPYRUS_API_BASE_URL }}
POWERSYNC_SERVICE_URL: ${{ vars.POWERSYNC_SERVICE_URL }}

jobs:
version:
Expand All @@ -29,7 +31,7 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: client
working-directory: app
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -47,16 +49,19 @@ jobs:
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true

- name: Create .dart_defines
run: echo '{"SUPABASE_URL":"${{ secrets.SUPABASE_URL }}","SUPABASE_ANON_KEY":"${{ secrets.SUPABASE_ANON_KEY }}"}' > .dart_defines
- name: Validate release configuration
run: |
test -n "${{ env.PAPYRUS_API_BASE_URL }}" || (echo "PAPYRUS_API_BASE_URL repository variable is required" && exit 1)
test -n "${{ env.POWERSYNC_SERVICE_URL }}" || (echo "POWERSYNC_SERVICE_URL repository variable is required" && exit 1)
Comment on lines +54 to +55

- name: Install dependencies
run: flutter pub get

- name: Build APK
run: |
flutter build apk --release \
--dart-define-from-file=.dart_defines \
--dart-define=PAPYRUS_API_BASE_URL="${{ env.PAPYRUS_API_BASE_URL }}" \
--dart-define=POWERSYNC_SERVICE_URL="${{ env.POWERSYNC_SERVICE_URL }}" \
Comment on lines +63 to +64
--build-name=${{ needs.version.outputs.version }} \
--build-number=${{ needs.version.outputs.build_number }}

Expand All @@ -69,15 +74,15 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: android-release
path: client/papyrus-android-v${{ needs.version.outputs.version }}.apk
path: app/papyrus-android-v${{ needs.version.outputs.version }}.apk

build-web:
name: Build Web
needs: version
runs-on: ubuntu-latest
defaults:
run:
working-directory: client
working-directory: app
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -88,16 +93,19 @@ jobs:
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true

- name: Create .dart_defines
run: echo '{"SUPABASE_URL":"${{ secrets.SUPABASE_URL }}","SUPABASE_ANON_KEY":"${{ secrets.SUPABASE_ANON_KEY }}"}' > .dart_defines
- name: Validate release configuration
run: |
test -n "${{ env.PAPYRUS_API_BASE_URL }}" || (echo "PAPYRUS_API_BASE_URL repository variable is required" && exit 1)
test -n "${{ env.POWERSYNC_SERVICE_URL }}" || (echo "POWERSYNC_SERVICE_URL repository variable is required" && exit 1)
Comment on lines +98 to +99

- name: Install dependencies
run: flutter pub get

- name: Build web
run: |
flutter build web --release \
--dart-define-from-file=.dart_defines \
--dart-define=PAPYRUS_API_BASE_URL="${{ env.PAPYRUS_API_BASE_URL }}" \
--dart-define=POWERSYNC_SERVICE_URL="${{ env.POWERSYNC_SERVICE_URL }}" \
Comment on lines +107 to +108
--build-name=${{ needs.version.outputs.version }} \
--build-number=${{ needs.version.outputs.build_number }}

Expand All @@ -110,15 +118,15 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: web-release
path: client/papyrus-web-v${{ needs.version.outputs.version }}.zip
path: app/papyrus-web-v${{ needs.version.outputs.version }}.zip

build-linux:
name: Build Linux
needs: version
runs-on: ubuntu-latest
defaults:
run:
working-directory: client
working-directory: app
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -134,16 +142,19 @@ jobs:
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true

- name: Create .dart_defines
run: echo '{"SUPABASE_URL":"${{ secrets.SUPABASE_URL }}","SUPABASE_ANON_KEY":"${{ secrets.SUPABASE_ANON_KEY }}"}' > .dart_defines
- name: Validate release configuration
run: |
test -n "${{ env.PAPYRUS_API_BASE_URL }}" || (echo "PAPYRUS_API_BASE_URL repository variable is required" && exit 1)
test -n "${{ env.POWERSYNC_SERVICE_URL }}" || (echo "POWERSYNC_SERVICE_URL repository variable is required" && exit 1)
Comment on lines +147 to +148

- name: Install dependencies
run: flutter pub get

- name: Build Linux
run: |
flutter build linux --release \
--dart-define-from-file=.dart_defines \
--dart-define=PAPYRUS_API_BASE_URL="${{ env.PAPYRUS_API_BASE_URL }}" \
--dart-define=POWERSYNC_SERVICE_URL="${{ env.POWERSYNC_SERVICE_URL }}" \
Comment on lines +156 to +157
--build-name=${{ needs.version.outputs.version }} \
--build-number=${{ needs.version.outputs.build_number }}

Expand All @@ -156,15 +167,15 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: linux-release
path: client/papyrus-linux-v${{ needs.version.outputs.version }}.tar.gz
path: app/papyrus-linux-v${{ needs.version.outputs.version }}.tar.gz

build-windows:
name: Build Windows
needs: version
runs-on: windows-latest
defaults:
run:
working-directory: client
working-directory: app
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -175,16 +186,19 @@ jobs:
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true

- name: Create .dart_defines
run: echo '{"SUPABASE_URL":"${{ secrets.SUPABASE_URL }}","SUPABASE_ANON_KEY":"${{ secrets.SUPABASE_ANON_KEY }}"}' > .dart_defines
- name: Validate release configuration
run: |
if (-not "${{ env.PAPYRUS_API_BASE_URL }}") { throw "PAPYRUS_API_BASE_URL repository variable is required" }
if (-not "${{ env.POWERSYNC_SERVICE_URL }}") { throw "POWERSYNC_SERVICE_URL repository variable is required" }
Comment on lines +191 to +192

- name: Install dependencies
run: flutter pub get

- name: Build Windows
run: |
flutter build windows --release `
--dart-define-from-file=.dart_defines `
--dart-define=PAPYRUS_API_BASE_URL="${{ env.PAPYRUS_API_BASE_URL }}" `
--dart-define=POWERSYNC_SERVICE_URL="${{ env.POWERSYNC_SERVICE_URL }}" `
Comment on lines +200 to +201
--build-name=${{ needs.version.outputs.version }} `
--build-number=${{ needs.version.outputs.build_number }}

Expand All @@ -196,7 +210,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: windows-release
path: client/papyrus-windows-v${{ needs.version.outputs.version }}.zip
path: app/papyrus-windows-v${{ needs.version.outputs.version }}.zip

release:
name: Create GitHub Release
Expand Down
Loading