mirror of
https://github.com/bitwarden/server.git
synced 2025-05-29 07:14:50 -05:00
Update workflow
This commit is contained in:
parent
cf6cfeb475
commit
96431771c2
122
.github/workflows/build.yml
vendored
122
.github/workflows/build.yml
vendored
@ -96,108 +96,12 @@ jobs:
|
|||||||
reporter: dotnet-trx
|
reporter: dotnet-trx
|
||||||
fail-on-error: true
|
fail-on-error: true
|
||||||
|
|
||||||
build-artifacts:
|
build:
|
||||||
if: false
|
name: Build artifacts and images
|
||||||
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
|
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
# needs:
|
||||||
|
# - lint
|
||||||
|
# - testing
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@ -326,8 +230,6 @@ jobs:
|
|||||||
mkdir build
|
mkdir build
|
||||||
docker run --rm --platform linux/amd64 --volume $(pwd)/build:/temp --entrypoint bash \
|
docker run --rm --platform linux/amd64 --volume $(pwd)/build:/temp --entrypoint bash \
|
||||||
${{ steps.image-name.outputs.name }} -c "cp -r ./ /temp"
|
${{ steps.image-name.outputs.name }} -c "cp -r ./ /temp"
|
||||||
ls -alh
|
|
||||||
ls -alh build
|
|
||||||
|
|
||||||
cd build
|
cd build
|
||||||
zip -r ${{ matrix.project_name }}.zip .
|
zip -r ${{ matrix.project_name }}.zip .
|
||||||
@ -350,7 +252,7 @@ jobs:
|
|||||||
upload:
|
upload:
|
||||||
name: Upload
|
name: Upload
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
needs: build-docker
|
needs: build
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
@ -534,7 +436,7 @@ jobs:
|
|||||||
self-host-build:
|
self-host-build:
|
||||||
name: Trigger self-host build
|
name: Trigger self-host build
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
needs: build-docker
|
needs: build
|
||||||
steps:
|
steps:
|
||||||
- name: Login to Azure - CI Subscription
|
- name: Login to Azure - CI Subscription
|
||||||
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7
|
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7
|
||||||
@ -571,8 +473,7 @@ jobs:
|
|||||||
- cloc
|
- cloc
|
||||||
- lint
|
- lint
|
||||||
- testing
|
- testing
|
||||||
- build-artifacts
|
- build
|
||||||
- build-docker
|
|
||||||
- upload
|
- upload
|
||||||
- build-mssqlmigratorutility
|
- build-mssqlmigratorutility
|
||||||
- self-host-build
|
- self-host-build
|
||||||
@ -586,8 +487,7 @@ jobs:
|
|||||||
CLOC_STATUS: ${{ needs.cloc.result }}
|
CLOC_STATUS: ${{ needs.cloc.result }}
|
||||||
LINT_STATUS: ${{ needs.lint.result }}
|
LINT_STATUS: ${{ needs.lint.result }}
|
||||||
TESTING_STATUS: ${{ needs.testing.result }}
|
TESTING_STATUS: ${{ needs.testing.result }}
|
||||||
BUILD_ARTIFACTS_STATUS: ${{ needs.build-artifacts.result }}
|
BUILD_STATUS: ${{ needs.build.result }}
|
||||||
BUILD_DOCKER_STATUS: ${{ needs.build-docker.result }}
|
|
||||||
UPLOAD_STATUS: ${{ needs.upload.result }}
|
UPLOAD_STATUS: ${{ needs.upload.result }}
|
||||||
BUILD_MSSQLMIGRATORUTILITY_STATUS: ${{ needs.build-mssqlmigratorutility.result }}
|
BUILD_MSSQLMIGRATORUTILITY_STATUS: ${{ needs.build-mssqlmigratorutility.result }}
|
||||||
TRIGGER_SELF_HOST_BUILD_STATUS: ${{ needs.self-host-build.result }}
|
TRIGGER_SELF_HOST_BUILD_STATUS: ${{ needs.self-host-build.result }}
|
||||||
@ -598,9 +498,7 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
elif [ "$TESTING_STATUS" = "failure" ]; then
|
elif [ "$TESTING_STATUS" = "failure" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
elif [ "$BUILD_ARTIFACTS_STATUS" = "failure" ]; then
|
elif [ "$BUILD_STATUS" = "failure" ]; then
|
||||||
exit 1
|
|
||||||
elif [ "$BUILD_DOCKER_STATUS" = "failure" ]; then
|
|
||||||
exit 1
|
exit 1
|
||||||
elif [ "$UPLOAD_STATUS" = "failure" ]; then
|
elif [ "$UPLOAD_STATUS" = "failure" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user