diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-client.yml similarity index 98% rename from .github/workflows/build-app.yml rename to .github/workflows/build-client.yml index 651cde3a..db8ed65d 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-client.yml @@ -1,4 +1,4 @@ -name: build app +name: build client on: workflow_dispatch: inputs: @@ -10,8 +10,6 @@ on: options: - 'any' - '3.16.x' - - '3.13.x' - - '3.10.x' enable_android: description: 'Build Android' required: false @@ -51,7 +49,7 @@ on: inputs: flutter_version: required: false - default: '3.16.2' + default: '3.16.9' type: string enable_android: required: false @@ -98,6 +96,7 @@ jobs: working-directory: ./wrestling_scoreboard_client run: | flutter build web \ + --build-name=0.0.0-nightly.$(echo $GITHUB_SHA::7) \ --base-href ${{ inputs.upload_pages_artifact && '"/wrestling_scoreboard/"' || '"/"' }} \ --dart-define=API_URL=https://server.wrestling-scoreboard.oberhauser.dev/api \ --dart-define=WEB_SOCKET_URL=wss://server.wrestling-scoreboard.oberhauser.dev/ws diff --git a/.github/workflows/build-server.yml b/.github/workflows/build-server.yml new file mode 100644 index 00000000..8b75acca --- /dev/null +++ b/.github/workflows/build-server.yml @@ -0,0 +1,48 @@ +name: build server +on: + workflow_dispatch: + inputs: + flutter_version: + description: 'Flutter Version' + required: false + default: 'any' + type: choice + options: + - 'any' + - '3.16.x' + workflow_call: + inputs: + flutter_version: + required: false + default: '3.16.9' + type: string + +jobs: + build-server: + name: Build Server for ${{ matrix.platform }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + platform: linux + - os: windows-latest + platform: windows + - os: macos-latest + platform: macos + steps: + - uses: actions/checkout@v3 + - uses: subosito/flutter-action@v2 + with: + flutter-version: ${{ inputs.flutter_version }} + channel: 'stable' + - name: Build + id: build + shell: bash + run: | + ARTIFACT_PATH=$(./build.sh -v 0.0.0-nightly.$(echo $GITHUB_SHA::7) | tail -1) + ARTIFACT_NAME=$(basename "$ARTIFACT_PATH") + echo "artifact-path=$(echo $ARTIFACT_PATH)" >> $GITHUB_OUTPUT + echo "artifact-name=$(echo $ARTIFACT_NAME)" >> $GITHUB_OUTPUT + working-directory: wrestling_scoreboard_server diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d4d704c4..bc5705eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ concurrency: jobs: call-build-client: - uses: ./.github/workflows/build-app.yml + uses: ./.github/workflows/build-client.yml with: upload_pages_artifact: true diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 00000000..e4819f15 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,28 @@ +name: pull-request +on: + pull_request: + types: + - opened + - reopened + - synchronize + - ready_for_review + +jobs: + call-test: + uses: ./.github/workflows/test.yml + call-build-server: + needs: + - call-test + uses: ./.github/workflows/build-server.yml + call-build-client: + needs: + - call-test + uses: ./.github/workflows/build-client.yml + with: + enable_android: ${{ github.event.pull_request.draft == false }} + enable_web: ${{ github.event.pull_request.draft == false }} + enable_ios: ${{ github.event.pull_request.draft == false }} + enable_windows: ${{ github.event.pull_request.draft == false }} + enable_linux: ${{ github.event.pull_request.draft == false }} + enable_macos: ${{ github.event.pull_request.draft == false }} + upload_pages_artifact: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b86681a9..ad4dfe30 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: - uses: actions/checkout@v3 - uses: subosito/flutter-action@v2 with: - flutter-version: '3.16.2' + flutter-version: '3.16.9' channel: 'stable' - name: Build id: build @@ -75,7 +75,7 @@ jobs: - uses: actions/checkout@v3 - uses: subosito/flutter-action@v2 with: - flutter-version: '3.16.2' + flutter-version: '3.16.9' channel: 'stable' - name: Install Linux Dependencies run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..13e20be9 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,58 @@ +name: test +on: + workflow_dispatch: + inputs: + flutter_version: + description: 'Flutter Version' + required: false + default: 'any' + type: choice + options: + - 'any' + - '3.16.x' + flutter_channel: + description: 'Flutter Channel' + required: false + default: 'stable' + type: choice + options: + - 'stable' + - 'beta' + - 'dev' + - 'master' + fatal_warnings: + description: 'Treat warnings as fatal' + required: false + default: true + type: boolean + + workflow_call: + inputs: + flutter_version: + required: false + default: '3.16.8' + type: string + flutter_channel: + required: false + default: 'stable' + type: string + fatal_warnings: + required: false + default: true + type: boolean + +jobs: + test: + runs-on: ubuntu-latest + timeout-minutes: 30 + + steps: + - uses: actions/checkout@v3 + - uses: subosito/flutter-action@v2 + with: + flutter-version: ${{ inputs.flutter_version }} + channel: ${{ inputs.flutter_channel }} + - uses: bluefireteam/melos-action@main + - run: melos run format-check + - run: melos run analyze -- ${{ inputs.fatal_warnings && '--fatal-infos' || '--no-fatal-warnings --no-fatal-infos' }} + - run: melos run test