diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7e0606ad54..601aa2bf79 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -96,108 +96,12 @@ jobs: reporter: dotnet-trx fail-on-error: true - build-artifacts: - if: false - name: Build artifacts - runs-on: ubuntu-22.04 - needs: - - testing - - lint - strategy: - fail-fast: false - matrix: - include: - - project_name: Admin - base_path: ./src - node: true - - project_name: Api - base_path: ./src - - project_name: Billing - base_path: ./src - - project_name: Events - base_path: ./src - - project_name: EventsProcessor - base_path: ./src - - project_name: Icons - base_path: ./src - - project_name: Identity - base_path: ./src - - project_name: MsSqlMigratorUtility - base_path: ./util - dotnet: true - - project_name: Notifications - base_path: ./src - - project_name: Scim - base_path: ./bitwarden_license/src - dotnet: true - - project_name: Server - base_path: ./util - - project_name: Setup - base_path: ./util - - project_name: Sso - base_path: ./bitwarden_license/src - node: true - steps: - - name: Checkout repo - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - - name: Set up dotnet - uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0 - - - name: Set up Node - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 - with: - cache: "npm" - cache-dependency-path: "**/package-lock.json" - node-version: "16" - - - name: Print environment - run: | - whoami - dotnet --info - node --version - npm --version - echo "GitHub ref: $GITHUB_REF" - echo "GitHub event: $GITHUB_EVENT" - - - name: Restore/Clean project - working-directory: ${{ matrix.base_path }}/${{ matrix.project_name }} - run: | - echo "Restore" - dotnet restore - echo "Clean" - dotnet clean -c "Release" -o obj/build-output/publish - - - name: Build node - if: ${{ matrix.node }} - working-directory: ${{ matrix.base_path }}/${{ matrix.project_name }} - run: | - npm ci - npm run build - - - name: Publish project - working-directory: ${{ matrix.base_path }}/${{ matrix.project_name }} - run: | - echo "Publish" - dotnet publish -c "Release" -o obj/build-output/publish - - cd obj/build-output/publish - zip -r ${{ matrix.project_name }}.zip . - mv ${{ matrix.project_name }}.zip ../../../ - - pwd - ls -atlh ../../../ - - - name: Upload project artifact - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 - with: - name: ${{ matrix.project_name }}.zip - path: ${{ matrix.base_path }}/${{ matrix.project_name }}/${{ matrix.project_name }}.zip - if-no-files-found: error - - build-docker: - name: Build Docker images + build: + name: Build artifacts and images runs-on: ubuntu-22.04 + # needs: + # - lint + # - testing strategy: fail-fast: false matrix: @@ -326,8 +230,6 @@ jobs: mkdir build docker run --rm --platform linux/amd64 --volume $(pwd)/build:/temp --entrypoint bash \ ${{ steps.image-name.outputs.name }} -c "cp -r ./ /temp" - ls -alh - ls -alh build cd build zip -r ${{ matrix.project_name }}.zip . @@ -350,7 +252,7 @@ jobs: upload: name: Upload runs-on: ubuntu-22.04 - needs: build-docker + needs: build steps: - name: Checkout repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 @@ -534,7 +436,7 @@ jobs: self-host-build: name: Trigger self-host build runs-on: ubuntu-22.04 - needs: build-docker + needs: build steps: - name: Login to Azure - CI Subscription uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7 @@ -571,8 +473,7 @@ jobs: - cloc - lint - testing - - build-artifacts - - build-docker + - build - upload - build-mssqlmigratorutility - self-host-build @@ -586,8 +487,7 @@ jobs: CLOC_STATUS: ${{ needs.cloc.result }} LINT_STATUS: ${{ needs.lint.result }} TESTING_STATUS: ${{ needs.testing.result }} - BUILD_ARTIFACTS_STATUS: ${{ needs.build-artifacts.result }} - BUILD_DOCKER_STATUS: ${{ needs.build-docker.result }} + BUILD_STATUS: ${{ needs.build.result }} UPLOAD_STATUS: ${{ needs.upload.result }} BUILD_MSSQLMIGRATORUTILITY_STATUS: ${{ needs.build-mssqlmigratorutility.result }} TRIGGER_SELF_HOST_BUILD_STATUS: ${{ needs.self-host-build.result }} @@ -598,9 +498,7 @@ jobs: exit 1 elif [ "$TESTING_STATUS" = "failure" ]; then exit 1 - elif [ "$BUILD_ARTIFACTS_STATUS" = "failure" ]; then - exit 1 - elif [ "$BUILD_DOCKER_STATUS" = "failure" ]; then + elif [ "$BUILD_STATUS" = "failure" ]; then exit 1 elif [ "$UPLOAD_STATUS" = "failure" ]; then exit 1