diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0920cb0ef..50bdc815f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build Web - MAIN +name: Build Web on: push: @@ -85,4 +85,140 @@ jobs: cp ../build/web/main.dart.js.map ./public/main.foss.dart.js.map git add . git commit -m 'New admin portal [selfhosted]' - git push \ No newline at end of file + git push + + build-next: + name: Build Web - NEXT + env: + commit_secret: ${{secrets.commit_secret}} + commit_email: ${{secrets.commit_email}} + commit_name: ${{secrets.commit_name}} + api_secret: ${{secrets.api_secret}} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: subosito/flutter-action@v1 + with: + channel: 'beta' + - name: Setup Flutter + run: | + flutter doctor -v + cp pubspec.next.yaml pubspec.yaml + rm pubspec.lock + flutter pub get + flutter config --enable-web + - name: Prepare App + run: | + cp lib/.env.dart.example lib/.env.dart + sed -i 's/secret/${{secrets.api_secret}}/g' lib/.env.dart + echo "const FLUTTER_VERSION = const " > lib/flutter_version.dart + flutter --version --machine >> lib/flutter_version.dart + echo ";" >> lib/flutter_version.dart + - name: Build Hosted App + run: | + flutter build web --web-renderer html --release + + sed -i '/index.html/d' build/web/flutter_service_worker.js + + git config --global user.email ${{secrets.commit_email}} + git config --global user.name ${{secrets.commit_name}} + + git clone https://${{secrets.commit_secret}}@github.com/invoiceninja/invoiceninja.git + cd invoiceninja + + git checkout v5-develop + cp ../build/web/main.dart.js ./public/main.next.dart.js + git add . + git commit -m 'New admin portal - Next [hosted]' + git push + cd .. + + build-last: + name: Build Web - LAST + env: + commit_secret: ${{secrets.commit_secret}} + commit_email: ${{secrets.commit_email}} + commit_name: ${{secrets.commit_name}} + api_secret: ${{secrets.api_secret}} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: subosito/flutter-action@v1 + with: + flutter-version: '2.0.3' + - name: Setup Flutter + run: | + flutter doctor -v + cp pubspec.last.yaml pubspec.yaml + rm pubspec.lock + flutter pub get + flutter config --enable-web + - name: Prepare App + run: | + cp lib/.env.dart.example lib/.env.dart + sed -i 's/secret/${{secrets.api_secret}}/g' lib/.env.dart + echo "const FLUTTER_VERSION = const " > lib/flutter_version.dart + flutter --version --machine >> lib/flutter_version.dart + echo ";" >> lib/flutter_version.dart + - name: Build Hosted App + run: | + flutter build web --web-renderer html --release + + sed -i '/index.html/d' build/web/flutter_service_worker.js + + git config --global user.email ${{secrets.commit_email}} + git config --global user.name ${{secrets.commit_name}} + + git clone https://${{secrets.commit_secret}}@github.com/invoiceninja/invoiceninja.git + cd invoiceninja + + git checkout v5-develop + cp ../build/web/main.dart.js ./public/main.last.dart.js + git add . + git commit -m 'New admin portal - Last [hosted]' + git push + cd .. + + build-wasm: + name: Build Web - WASM + env: + commit_secret: ${{secrets.commit_secret}} + commit_email: ${{secrets.commit_email}} + commit_name: ${{secrets.commit_name}} + api_secret: ${{secrets.api_secret}} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: subosito/flutter-action@v1 + with: + flutter-version: '2.2.3' + - name: Setup Flutter + run: | + flutter doctor -v + flutter pub get + flutter config --enable-web + - name: Prepare App + run: | + cp lib/.env.dart.example lib/.env.dart + sed -i 's/secret/${{secrets.api_secret}}/g' lib/.env.dart + echo "const FLUTTER_VERSION = const " > lib/flutter_version.dart + flutter --version --machine >> lib/flutter_version.dart + echo ";" >> lib/flutter_version.dart + - name: Build Hosted App + run: | + flutter build web --web-renderer canvaskit --release + + sed -i '/index.html/d' build/web/flutter_service_worker.js + + git config --global user.email ${{secrets.commit_email}} + git config --global user.name ${{secrets.commit_name}} + + git clone https://${{secrets.commit_secret}}@github.com/invoiceninja/invoiceninja.git + cd invoiceninja + + git checkout v5-develop + cp ../build/web/main.dart.js ./public/main.wasm.dart.js + git add . + git commit -m 'New admin portal - WASM [hosted]' + git push + cd .. \ No newline at end of file diff --git a/.github/workflows/build_last.yml b/.github/workflows/build_last.yml index 16d13c715..05420528a 100644 --- a/.github/workflows/build_last.yml +++ b/.github/workflows/build_last.yml @@ -5,7 +5,7 @@ on: branches: - master jobs: - build-current: + build-last: name: Build Web - LAST env: commit_secret: ${{secrets.commit_secret}} diff --git a/.github/workflows/build_next.yml b/.github/workflows/build_next.yml index 25ed320e5..82715ef71 100644 --- a/.github/workflows/build_next.yml +++ b/.github/workflows/build_next.yml @@ -5,7 +5,7 @@ on: branches: - master jobs: - build-current: + build-next: name: Build Web - NEXT env: commit_secret: ${{secrets.commit_secret}} diff --git a/.github/workflows/build_wasm.yml b/.github/workflows/build_wasm.yml index f2ce4bfa5..aa5bf759b 100644 --- a/.github/workflows/build_wasm.yml +++ b/.github/workflows/build_wasm.yml @@ -5,7 +5,7 @@ on: branches: - master jobs: - build-current: + build-wasm: name: Build Web - WASM env: commit_secret: ${{secrets.commit_secret}}