Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always publish build artifacts, if built #187134

Merged
merged 10 commits into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
56 changes: 24 additions & 32 deletions build/azure-pipelines/alpine/product-build-alpine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,55 +104,47 @@ steps:

- script: |
set -e
TARGET=$([ "$VSCODE_ARCH" == "x64" ] && echo "linux-alpine" || echo "alpine-arm64")
TARGET=$([ "$VSCODE_ARCH" == "x64" ] && echo "linux-alpine" || echo "alpine-arm64") # TODO@joaomoreno
yarn gulp vscode-reh-$TARGET-min-ci
yarn gulp vscode-reh-web-$TARGET-min-ci
(cd .. && mv vscode-reh-$TARGET vscode-server-$TARGET) # TODO@joaomoreno
ARCHIVE_PATH=".build/linux/server/vscode-server-$TARGET.tar.gz"
mkdir -p $(dirname $ARCHIVE_PATH)
tar --owner=0 --group=0 -czf $ARCHIVE_PATH -C .. vscode-server-$TARGET
echo "##vso[task.setvariable variable=SERVER_PATH]$ARCHIVE_PATH"
env:
GITHUB_TOKEN: "$(github-distro-mixin-password)"
displayName: Build
displayName: Build server

- script: |
set -e
TARGET=$([ "$VSCODE_ARCH" == "x64" ] && echo "linux-alpine" || echo "alpine-arm64")
REPO="$(pwd)"
ROOT="$REPO/.."

# Publish Remote Extension Host
LEGACY_SERVER_BUILD_NAME="vscode-reh-$TARGET"
SERVER_BUILD_NAME="vscode-server-$TARGET"
SERVER_TARBALL_FILENAME="vscode-server-$TARGET.tar.gz"
SERVER_TARBALL_PATH="$ROOT/$SERVER_TARBALL_FILENAME"

rm -rf $ROOT/vscode-server-*.tar.*
(cd $ROOT && mv $LEGACY_SERVER_BUILD_NAME $SERVER_BUILD_NAME && tar --owner=0 --group=0 -czf $SERVER_TARBALL_PATH $SERVER_BUILD_NAME)

# Publish Remote Extension Host (Web)
LEGACY_SERVER_BUILD_NAME="vscode-reh-web-$TARGET"
SERVER_BUILD_NAME="vscode-server-$TARGET-web"
SERVER_TARBALL_FILENAME="vscode-server-$TARGET-web.tar.gz"
SERVER_TARBALL_PATH="$ROOT/$SERVER_TARBALL_FILENAME"

rm -rf $ROOT/vscode-server-*-web.tar.*
(cd $ROOT && mv $LEGACY_SERVER_BUILD_NAME $SERVER_BUILD_NAME && tar --owner=0 --group=0 -czf $SERVER_TARBALL_PATH $SERVER_BUILD_NAME)
displayName: Prepare for publish
yarn gulp vscode-reh-web-$TARGET-min-ci
(cd .. && mv vscode-reh-web-$TARGET vscode-server-$TARGET-web) # TODO@joaomoreno
ARCHIVE_PATH=".build/linux/web/vscode-server-$TARGET-web.tar.gz"
mkdir -p $(dirname $ARCHIVE_PATH)
tar --owner=0 --group=0 -czf $ARCHIVE_PATH -C .. vscode-server-$TARGET-web
echo "##vso[task.setvariable variable=WEB_PATH]$ARCHIVE_PATH"
env:
GITHUB_TOKEN: "$(github-distro-mixin-password)"
displayName: Build server (web)

- publish: $(Agent.BuildDirectory)/vscode-server-alpine-$(VSCODE_ARCH).tar.gz
- publish: $(SERVER_PATH)
artifact: vscode_server_alpine_$(VSCODE_ARCH)_archive-unsigned
displayName: Publish server archive
condition: and(succeeded(), ne(variables['VSCODE_ARCH'], 'x64'))
condition: and(succeededOrFailed(), ne(variables['SERVER_PATH'], ''), ne(variables['VSCODE_ARCH'], 'x64'))

- publish: $(Agent.BuildDirectory)/vscode-server-alpine-$(VSCODE_ARCH)-web.tar.gz
- publish: $(WEB_PATH)
artifact: vscode_web_alpine_$(VSCODE_ARCH)_archive-unsigned
displayName: Publish web server archive
condition: and(succeeded(), ne(variables['VSCODE_ARCH'], 'x64'))
condition: and(succeededOrFailed(), ne(variables['WEB_PATH'], ''), ne(variables['VSCODE_ARCH'], 'x64'))

# Legacy x64 artifact name
- publish: $(Agent.BuildDirectory)/vscode-server-linux-alpine.tar.gz
- publish: $(SERVER_PATH)
artifact: vscode_server_linux_alpine_archive-unsigned
displayName: Publish x64 server archive
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'))
condition: and(succeededOrFailed(), ne(variables['SERVER_PATH'], ''), eq(variables['VSCODE_ARCH'], 'x64'))

- publish: $(Agent.BuildDirectory)/vscode-server-linux-alpine-web.tar.gz
- publish: $(WEB_PATH)
artifact: vscode_web_linux_alpine_archive-unsigned
displayName: Publish x64 web server archive
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'))
condition: and(succeededOrFailed(), ne(variables['WEB_PATH'], ''), eq(variables['VSCODE_ARCH'], 'x64'))
10 changes: 5 additions & 5 deletions build/azure-pipelines/darwin/product-build-darwin-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ steps:
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME/Contents/MacOS/Electron" \
./scripts/test-integration.sh --build --tfs "Integration Tests"
env:
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-reh-darwin-$(VSCODE_ARCH)
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-darwin-$(VSCODE_ARCH)
displayName: Run integration tests (Electron)
timeoutInMinutes: 20

- script: ./scripts/test-web-integration.sh --browser webkit
env:
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-reh-web-darwin-$(VSCODE_ARCH)
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-darwin-$(VSCODE_ARCH)-web
displayName: Run integration tests (Browser, Webkit)
timeoutInMinutes: 20

Expand All @@ -101,7 +101,7 @@ steps:
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME/Contents/MacOS/Electron" \
./scripts/test-remote-integration.sh
env:
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-reh-darwin-$(VSCODE_ARCH)
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-darwin-$(VSCODE_ARCH)
displayName: Run integration tests (Remote)
timeoutInMinutes: 20

Expand Down Expand Up @@ -133,7 +133,7 @@ steps:

- script: yarn smoketest-no-compile --web --tracing --headless
env:
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-reh-web-darwin-$(VSCODE_ARCH)
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-darwin-$(VSCODE_ARCH)-web
timeoutInMinutes: 20
displayName: Run smoke tests (Browser, Chromium)

Expand All @@ -144,7 +144,7 @@ steps:
APP_NAME="`ls $APP_ROOT | head -n 1`"
yarn smoketest-no-compile --tracing --remote --build "$APP_ROOT/$APP_NAME"
env:
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-reh-darwin-$(VSCODE_ARCH)
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-darwin-$(VSCODE_ARCH)
timeoutInMinutes: 20
displayName: Run smoke tests (Remote)

Expand Down
59 changes: 32 additions & 27 deletions build/azure-pipelines/darwin/product-build-darwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,34 @@ steps:
- template: ../common/install-builtin-extensions.yml

- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
- script: yarn gulp vscode-darwin-$(VSCODE_ARCH)-min-ci
- script: |
set -e
yarn gulp vscode-darwin-$(VSCODE_ARCH)-min-ci
echo "##vso[task.setvariable variable=BUILT_CLIENT]true"
env:
GITHUB_TOKEN: "$(github-distro-mixin-password)"
displayName: Build client

- script: yarn gulp vscode-reh-darwin-$(VSCODE_ARCH)-min-ci
- script: |
set -e
yarn gulp vscode-reh-darwin-$(VSCODE_ARCH)-min-ci
mv ../vscode-reh-darwin-$(VSCODE_ARCH) ../vscode-server-darwin-$(VSCODE_ARCH) # TODO@joaomoreno
ARCHIVE_PATH=".build/darwin/server/vscode-server-darwin-$(VSCODE_ARCH).zip"
mkdir -p $(dirname $ARCHIVE_PATH)
(cd .. && zip -Xry $(Build.SourcesDirectory)/$ARCHIVE_PATH vscode-server-darwin-$(VSCODE_ARCH))
echo "##vso[task.setvariable variable=SERVER_PATH]$ARCHIVE_PATH"
env:
GITHUB_TOKEN: "$(github-distro-mixin-password)"
displayName: Build server

- script: yarn gulp vscode-reh-web-darwin-$(VSCODE_ARCH)-min-ci
- script: |
set -e
yarn gulp vscode-reh-web-darwin-$(VSCODE_ARCH)-min-ci
mv ../vscode-reh-web-darwin-$(VSCODE_ARCH) ../vscode-server-darwin-$(VSCODE_ARCH)-web # TODO@joaomoreno
ARCHIVE_PATH=".build/darwin/server/vscode-server-darwin-$(VSCODE_ARCH)-web.zip"
mkdir -p $(dirname $ARCHIVE_PATH)
(cd .. && zip -Xry $(Build.SourcesDirectory)/$ARCHIVE_PATH vscode-server-darwin-$(VSCODE_ARCH)-web)
echo "##vso[task.setvariable variable=WEB_PATH]$ARCHIVE_PATH"
env:
GITHUB_TOKEN: "$(github-distro-mixin-password)"
displayName: Build server (web)
Expand Down Expand Up @@ -176,18 +193,14 @@ steps:
DEBUG=electron-osx-sign* node build/darwin/sign.js $(agent.builddirectory)
displayName: Set Hardened Entitlements

- script: cd $(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH) && zip -r -X -y $(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH).zip *
displayName: Archive build

- script: |
set -e

# package Remote Extension Host
pushd .. && mv vscode-reh-darwin-$(VSCODE_ARCH) vscode-server-darwin-$(VSCODE_ARCH) && zip -Xry vscode-server-darwin-$(VSCODE_ARCH).zip vscode-server-darwin-$(VSCODE_ARCH) && popd

# package Remote Extension Host (Web)
pushd .. && mv vscode-reh-web-darwin-$(VSCODE_ARCH) vscode-server-darwin-$(VSCODE_ARCH)-web && zip -Xry vscode-server-darwin-$(VSCODE_ARCH)-web.zip vscode-server-darwin-$(VSCODE_ARCH)-web && popd
displayName: Prepare to publish servers
ARCHIVE_PATH=".build/darwin/client/VSCode-darwin-$(VSCODE_ARCH).zip"
mkdir -p $(dirname $ARCHIVE_PATH)
(cd ../VSCode-darwin-$(VSCODE_ARCH) && zip -Xry $(Build.SourcesDirectory)/$ARCHIVE_PATH *)
echo "##vso[task.setvariable variable=CLIENT_PATH]$ARCHIVE_PATH"
condition: and(succeededOrFailed(), eq(variables['BUILT_CLIENT'], 'true'))
displayName: Package client

- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
displayName: Generate SBOM (client)
Expand All @@ -209,25 +222,17 @@ steps:
displayName: Publish SBOM (server)
artifact: vscode_server_darwin_$(VSCODE_ARCH)_sbom

- publish: $(Agent.BuildDirectory)/VSCode-darwin-$(VSCODE_ARCH).zip
- publish: $(CLIENT_PATH)
artifact: unsigned_vscode_client_darwin_$(VSCODE_ARCH)_archive
condition: and(succeededOrFailed(), ne(variables['CLIENT_PATH'], ''))
displayName: Publish client archive

- publish: $(Agent.BuildDirectory)/vscode-server-darwin-$(VSCODE_ARCH).zip
- publish: $(SERVER_PATH)
artifact: vscode_server_darwin_$(VSCODE_ARCH)_archive-unsigned
condition: and(succeededOrFailed(), ne(variables['SERVER_PATH'], ''))
displayName: Publish server archive

- publish: $(Agent.BuildDirectory)/vscode-server-darwin-$(VSCODE_ARCH)-web.zip
- publish: $(WEB_PATH)
artifact: vscode_web_darwin_$(VSCODE_ARCH)_archive-unsigned
condition: and(succeededOrFailed(), ne(variables['WEB_PATH'], ''))
displayName: Publish web server archive

- task: AzureCLI@2
inputs:
azureSubscription: "vscode-builds-subscription"
scriptType: pscore
scriptLocation: inlineScript
addSpnToEnvironment: true
inlineScript: |
Write-Host "##vso[task.setvariable variable=AZURE_TENANT_ID]$env:tenantId"
Write-Host "##vso[task.setvariable variable=AZURE_CLIENT_ID]$env:servicePrincipalId"
Write-Host "##vso[task.setvariable variable=AZURE_CLIENT_SECRET;issecret=true]$env:servicePrincipalKey"
66 changes: 0 additions & 66 deletions build/azure-pipelines/linux/prepare-publish.sh

This file was deleted.

10 changes: 5 additions & 5 deletions build/azure-pipelines/linux/product-build-linux-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ steps:
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \
./scripts/test-integration.sh --build --tfs "Integration Tests"
env:
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-reh-linux-$(VSCODE_ARCH)
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)
displayName: Run integration tests (Electron)
timeoutInMinutes: 20

- script: ./scripts/test-web-integration.sh --browser chromium
env:
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-reh-web-linux-$(VSCODE_ARCH)
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)-web
displayName: Run integration tests (Browser, Chromium)
timeoutInMinutes: 20

Expand All @@ -140,7 +140,7 @@ steps:
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \
./scripts/test-remote-integration.sh
env:
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-reh-linux-$(VSCODE_ARCH)
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)
displayName: Run integration tests (Remote)
timeoutInMinutes: 20

Expand Down Expand Up @@ -180,15 +180,15 @@ steps:

- script: yarn smoketest-no-compile --web --tracing --headless --electronArgs="--disable-dev-shm-usage"
env:
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-reh-web-linux-$(VSCODE_ARCH)
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)-web
timeoutInMinutes: 20
displayName: Run smoke tests (Browser, Chromium)

- script: |
set -e
yarn gulp compile-extension:vscode-test-resolver
APP_PATH=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-linux-$(VSCODE_ARCH)" \
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)" \
yarn smoketest-no-compile --tracing --remote --build "$APP_PATH"
timeoutInMinutes: 20
displayName: Run smoke tests (Remote)
Expand Down