fluffychat/.github/workflows/main_deploy.yaml
wcjord 9ada5f6748
fix: upload Sentry source maps correctly for both staging and production (#5763)
- Remove SENTRY_RELEASE override in staging that caused a release tag
  mismatch (commit SHA vs pubspec version). The sentry_dart_plugin now
  auto-detects the same release name the SDK sends at runtime.
- Add update_sentry job to production release workflow (was missing entirely).
- Hardcode SENTRY_ORG and SENTRY_PROJECT since they were never set as
  GitHub environment variables, causing silent upload failures.
2026-02-23 10:12:58 -05:00

95 lines
2.8 KiB
YAML

name: Main Deploy Workflow
on:
push:
branches:
- main
workflow_dispatch:
env:
WEB_APP_ENV: ${{ vars.WEB_APP_ENV }}
ENV_OVERRIDES: ${{ vars.ENV_OVERRIDES }}
jobs:
build_web:
runs-on: ubuntu-latest
environment: staging
steps:
- uses: actions/checkout@v6
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- uses: moonrepo/setup-rust@v1
- run: rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
- name: Prepare web
run: ./scripts/prepare-web.sh
- run: rm ./assets/vodozemac/.gitignore
- run: flutter pub get
- name: Build Release Web
run: |
flutter config --enable-web
flutter clean
flutter pub get
flutter build web --dart-define=FLUTTER_WEB_CANVASKIT_URL=canvaskit/ --profile --source-maps
- name: Upload files
uses: actions/upload-artifact@v4
with:
name: web
path: build/web
deploy_web:
runs-on: ubuntu-latest
needs: build_web
environment: staging
steps:
- name: Download web
uses: actions/download-artifact@v4
with:
name: web
path: build/web
- name: Update Website files
run: |
mv build/web public
touch public/.env
echo "$WEB_APP_ENV" >> public/.env
cp public/.env public/assets/.env
touch public/assets/envs.json
echo "$ENV_OVERRIDES" >> public/assets/envs.json
mkdir -p public/.well-known
curl https://app.pangea.chat/.well-known/apple-app-site-association \
-o public/.well-known/apple-app-site-association
curl https://app.pangea.chat/.well-known/assetlinks.json \
-o public/.well-known/assetlinks.json
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
personal_token: ${{ secrets.PAGES_DEPLOY_TOKEN }}
publish_dir: ./public
publish_branch: gh-pages
cname: app.staging.pangea.chat
update_sentry:
runs-on: ubuntu-latest
needs: build_web
environment: staging
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_PROJECT: client
SENTRY_ORG: pangea-chat
steps:
- uses: actions/checkout@v6
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: Download web
uses: actions/download-artifact@v4
with:
name: web
path: build/web
- name: Update packages
run: flutter pub get
- name: Update sentry
run: flutter packages pub run sentry_dart_plugin