mirror of
https://github.com/jagandeepbrar/lunasea.git
synced 2026-08-31 20:52:32 +00:00
105 lines
2.8 KiB
YAML
105 lines
2.8 KiB
YAML
name: '[Release] Web'
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
build_flavor:
|
|
required: true
|
|
type: string
|
|
build_number:
|
|
required: true
|
|
type: string
|
|
channel:
|
|
required: true
|
|
type: string
|
|
|
|
secrets:
|
|
DISCORD_WEBHOOK:
|
|
required: true
|
|
FIREBASE_OPTIONS:
|
|
required: true
|
|
NETLIFY_AUTH_TOKEN:
|
|
required: true
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Download Source Files
|
|
uses: actions/download-artifact@v2
|
|
with:
|
|
name: lib-${{ github.sha }}
|
|
path: ${{ github.workspace }}/lib
|
|
|
|
- name: Download Localization Files
|
|
uses: actions/download-artifact@v2
|
|
with:
|
|
name: localization-${{ github.sha }}
|
|
path: ${{ github.workspace }}/assets/localization
|
|
|
|
- name: Install Secrets
|
|
working-directory: ${{ github.workspace }}
|
|
run: |
|
|
echo ${{ secrets.FIREBASE_OPTIONS }} | base64 --decode > lib/firebase_options.dart
|
|
|
|
- name: Install Flutter
|
|
uses: subosito/flutter-action@v2
|
|
with:
|
|
channel: stable
|
|
cache: true
|
|
cache-key: ${{ github.sha }}
|
|
|
|
- name: Setup Flutter
|
|
working-directory: ${{ github.workspace }}
|
|
run: |
|
|
flutter pub get
|
|
|
|
- name: Build LunaSea
|
|
working-directory: ${{ github.workspace }}
|
|
run: |
|
|
flutter build web --web-renderer canvaskit --release --build-number=${{ inputs.build_number }}
|
|
|
|
- name: Upload Web Build Artifact
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: web-${{ inputs.build_flavor }}-${{ github.sha }}
|
|
path: ${{ github.workspace }}/build/web
|
|
|
|
- name: Send Discord Message
|
|
uses: sarisia/actions-status-discord@v1
|
|
if: always()
|
|
env:
|
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
|
with:
|
|
title: '`[${{ inputs.build_flavor }}]` Web Build'
|
|
description: web-${{ inputs.build_flavor }}-${{ github.sha }}
|
|
|
|
deploy:
|
|
name: Deploy
|
|
runs-on: ubuntu-latest
|
|
needs: [ build ]
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Download Web Build Artifact
|
|
uses: actions/download-artifact@v2
|
|
with:
|
|
name: web-${{ inputs.build_flavor }}-${{ github.sha }}
|
|
path: ${{ github.workspace }}/build/web
|
|
|
|
- name: Deploy to Netlify
|
|
uses: nwtgck/actions-netlify@v1.2
|
|
env:
|
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
|
NETLIFY_SITE_ID: ${{ inputs.channel }}
|
|
with:
|
|
publish-dir: ${{ github.workspace}}/build/web
|
|
deploy-message: ${{ github.sha }}
|