Merge pull request #609 from stripedpajamas/windows-gh

This commit is contained in:
Peter Squicciarini
2021-01-12 23:31:12 -08:00
committed by GitHub
9 changed files with 219 additions and 175 deletions

89
.github/workflows/windows.yml vendored Normal file
View File

@@ -0,0 +1,89 @@
name: windows_build
on:
schedule:
- cron: '0 0 * * *'
push:
pull_request:
branches: [ master ]
jobs:
windows:
runs-on: windows-2016
env:
VSCODE_ARCH: ${{ matrix.vscode_arch }}
OS_NAME: 'windows'
strategy:
fail-fast: false
matrix:
vscode_arch: [x64, ia32, arm64]
steps:
- uses: actions/checkout@v2
- name: Setup Node.js environment
uses: actions/setup-node@v1
with:
node-version: 12.18.3
- name: Install Yarn
run: npm install -g yarn
- name: Setup Python 2
uses: actions/setup-python@v2
with:
python-version: '2.x'
- name: Clone VSCode repo
run: ./get_repo.sh
shell: bash
- name: Check existing VSCodium tags/releases
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./check_tags.sh
shell: bash
- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
npm_config_arch: ${{ matrix.vscode_arch }}
npm_config_target_arch: ${{ matrix.vscode_arch }}
run: ./build.sh
shell: bash
if: env.SHOULD_BUILD == 'yes'
- name: Move/rename build artifacts
run: |
mv vscode\\.build\\win32-${VSCODE_ARCH}\\system-setup\\VSCodeSetup.exe VSCodiumSetup-${VSCODE_ARCH}-${LATEST_MS_TAG}.exe
mv vscode\\.build\\win32-${VSCODE_ARCH}\\user-setup\\VSCodeSetup.exe VSCodiumUserSetup-${VSCODE_ARCH}-${LATEST_MS_TAG}.exe
mv vscode\\.build\\win32-${VSCODE_ARCH}\\archive\\VSCode-win32-${VSCODE_ARCH}.zip VSCodium-win32-${VSCODE_ARCH}-${LATEST_MS_TAG}.zip
shell: bash
if: env.SHOULD_BUILD == 'yes'
- name: Generate shasums
run: ./sum.sh
shell: bash
if: env.SHOULD_BUILD == 'yes'
- name: Release
uses: softprops/action-gh-release@v1
if: env.SHOULD_BUILD == 'yes'
with:
tag_name: ${{ env.LATEST_MS_TAG }}
files: |
./*.sha256
./VSCodium*.zip
./VSCodiumUserSetup*.exe
./VSCodiumSetup*.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update versions repo
if: env.SHOULD_BUILD == 'yes'
run: ./update_version.sh
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
GITHUB_USERNAME: ${{ github.repository_owner }}

View File

@@ -1,16 +0,0 @@
jobs:
- job: Windows
pool:
vmImage: VS2017-Win2016
variables:
BUILDARCH: x64
steps:
- template: win32-build.yml
- job: Windows32
pool:
vmImage: VS2017-Win2016
variables:
BUILDARCH: ia32
steps:
- template: win32-build.yml

View File

@@ -5,14 +5,7 @@ set -ex
if [[ "$SHOULD_BUILD" == "yes" ]]; then if [[ "$SHOULD_BUILD" == "yes" ]]; then
npm config set scripts-prepend-node-path true npm config set scripts-prepend-node-path true
export BUILD_SOURCEVERSION=$LATEST_MS_COMMIT
echo "LATEST_MS_COMMIT: ${LATEST_MS_COMMIT}" echo "LATEST_MS_COMMIT: ${LATEST_MS_COMMIT}"
echo "BUILD_SOURCEVERSION: ${BUILD_SOURCEVERSION}"
if [[ "$CI_WINDOWS" == "True" ]]; then
export npm_config_arch="$BUILDARCH"
export npm_config_target_arch="$BUILDARCH"
fi
. prepare_vscode.sh . prepare_vscode.sh
@@ -27,14 +20,14 @@ if [[ "$SHOULD_BUILD" == "yes" ]]; then
if [[ "$OS_NAME" == "osx" ]]; then if [[ "$OS_NAME" == "osx" ]]; then
yarn gulp "vscode-darwin-${VSCODE_ARCH}-min-ci" yarn gulp "vscode-darwin-${VSCODE_ARCH}-min-ci"
elif [[ "$CI_WINDOWS" == "True" ]]; then elif [[ "$OS_NAME" == "windows" ]]; then
cp LICENSE.txt LICENSE.rtf # windows build expects rtf license cp LICENSE.txt LICENSE.rtf # windows build expects rtf license
yarn gulp "vscode-win32-${BUILDARCH}-min-ci" yarn gulp "vscode-win32-${VSCODE_ARCH}-min-ci"
yarn gulp "vscode-win32-${BUILDARCH}-code-helper" yarn gulp "vscode-win32-${VSCODE_ARCH}-code-helper"
yarn gulp "vscode-win32-${BUILDARCH}-inno-updater" yarn gulp "vscode-win32-${VSCODE_ARCH}-inno-updater"
yarn gulp "vscode-win32-${BUILDARCH}-archive" yarn gulp "vscode-win32-${VSCODE_ARCH}-archive"
yarn gulp "vscode-win32-${BUILDARCH}-system-setup" yarn gulp "vscode-win32-${VSCODE_ARCH}-system-setup"
yarn gulp "vscode-win32-${BUILDARCH}-user-setup" yarn gulp "vscode-win32-${VSCODE_ARCH}-user-setup"
else # linux else # linux
yarn gulp "vscode-linux-${VSCODE_ARCH}-min-ci" yarn gulp "vscode-linux-${VSCODE_ARCH}-min-ci"
if [[ "$SKIP_LINUX_PACKAGES" != "True" ]]; then if [[ "$SKIP_LINUX_PACKAGES" != "True" ]]; then

View File

@@ -15,7 +15,67 @@ if [ "$GITHUB_TOKEN" != "" ]; then
echo "Building on Mac because we have no ZIP" echo "Building on Mac because we have no ZIP"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
fi fi
elif [[ $VSCODE_ARCH == "arm64" ]]; then elif [[ "$OS_NAME" == "windows" ]]; then
if [[ $VSCODE_ARCH == "arm64" ]]; then
HAVE_ARM64_SYS=$(echo $VSCODIUM_ASSETS | jq --arg suffix "$VSCODE_ARCH-$LATEST_MS_TAG.exe" 'map(.name) | contains([$suffix])')
HAVE_ARM64_USR=$(echo $VSCODIUM_ASSETS | jq --arg suffix "UserSetup-$VSCODE_ARCH-$LATEST_MS_TAG.exe" 'map(.name) | contains([$suffix])')
HAVE_ARM64_ZIP=$(echo $VSCODIUM_ASSETS | jq --arg suffix "win32-$VSCODE_ARCH-$LATEST_MS_TAG.zip" 'map(.name) | contains([$suffix])')
if [[ "$HAVE_ARM64_SYS" != "true" ]]; then
echo "Building on Windows arm64 because we have no system setup"
export SHOULD_BUILD="yes"
fi
if [[ "$HAVE_ARM64_USR" != "true" ]]; then
echo "Building on Windows arm64 because we have no user setup"
export SHOULD_BUILD="yes"
fi
if [[ "$HAVE_ARM64_ZIP" != "true" ]]; then
echo "Building on Windows arm64 because we have no zip"
export SHOULD_BUILD="yes"
fi
if [[ "$SHOULD_BUILD" != "yes" ]]; then
echo "Already have all the Windows arm64 builds"
fi
elif [[ $VSCODE_ARCH == "ia32" ]]; then
HAVE_IA32_SYS=$(echo $VSCODIUM_ASSETS | jq --arg suffix "$VSCODE_ARCH-$LATEST_MS_TAG.exe" 'map(.name) | contains([$suffix])')
HAVE_IA32_USR=$(echo $VSCODIUM_ASSETS | jq --arg suffix "UserSetup-$VSCODE_ARCH-$LATEST_MS_TAG.exe" 'map(.name) | contains([$suffix])')
HAVE_IA32_ZIP=$(echo $VSCODIUM_ASSETS | jq --arg suffix "win32-$VSCODE_ARCH-$LATEST_MS_TAG.zip" 'map(.name) | contains([$suffix])')
if [[ "$HAVE_IA32_SYS" != "true" ]]; then
echo "Building on Windows ia32 because we have no system setup"
export SHOULD_BUILD="yes"
fi
if [[ "$HAVE_IA32_USR" != "true" ]]; then
echo "Building on Windows ia32 because we have no user setup"
export SHOULD_BUILD="yes"
fi
if [[ "$HAVE_IA32_ZIP" != "true" ]]; then
echo "Building on Windows ia32 because we have no zip"
export SHOULD_BUILD="yes"
fi
if [[ "$SHOULD_BUILD" != "yes" ]]; then
echo "Already have all the Windows ia32 builds"
fi
else # Windows x64
HAVE_X64_SYS=$(echo $VSCODIUM_ASSETS | jq --arg suffix "$VSCODE_ARCH-$LATEST_MS_TAG.exe" 'map(.name) | contains([$suffix])')
HAVE_X64_USR=$(echo $VSCODIUM_ASSETS | jq --arg suffix "UserSetup-$VSCODE_ARCH-$LATEST_MS_TAG.exe" 'map(.name) | contains([$suffix])')
HAVE_X64_ZIP=$(echo $VSCODIUM_ASSETS | jq --arg suffix "win32-$VSCODE_ARCH-$LATEST_MS_TAG.zip" 'map(.name) | contains([$suffix])')
if [[ "$HAVE_X64_SYS" != "true" ]]; then
echo "Building on Windows x64 because we have no system setup"
export SHOULD_BUILD="yes"
fi
if [[ "$HAVE_X64_USR" != "true" ]]; then
echo "Building on Windows x64 because we have no user setup"
export SHOULD_BUILD="yes"
fi
if [[ "$HAVE_X64_ZIP" != "true" ]]; then
echo "Building on Windows x64 because we have no zip"
export SHOULD_BUILD="yes"
fi
if [[ "$SHOULD_BUILD" != "yes" ]]; then
echo "Already have all the Windows x64 builds"
fi
fi
elif [[ "$OS_NAME" == "linux" ]]; then
if [[ $VSCODE_ARCH == "arm64" ]]; then
HAVE_ARM64_DEB=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["arm64.deb"])') HAVE_ARM64_DEB=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["arm64.deb"])')
HAVE_ARM64_TAR=$(echo $VSCODIUM_ASSETS | jq --arg suffix "arm64-$LATEST_MS_TAG.tar.gz" 'map(.name) | contains([$suffix])') HAVE_ARM64_TAR=$(echo $VSCODIUM_ASSETS | jq --arg suffix "arm64-$LATEST_MS_TAG.tar.gz" 'map(.name) | contains([$suffix])')
if [[ "$HAVE_ARM64_DEB" != "true" ]]; then if [[ "$HAVE_ARM64_DEB" != "true" ]]; then
@@ -43,7 +103,7 @@ if [ "$GITHUB_TOKEN" != "" ]; then
if [[ "$SHOULD_BUILD" != "yes" ]]; then if [[ "$SHOULD_BUILD" != "yes" ]]; then
echo "Already have all the Linux arm builds" echo "Already have all the Linux arm builds"
fi fi
else else # Linux x64
HAVE_64_RPM=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["x86_64.rpm"])') HAVE_64_RPM=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["x86_64.rpm"])')
HAVE_64_DEB=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["amd64.deb"])') HAVE_64_DEB=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["amd64.deb"])')
HAVE_64_TAR=$(echo $VSCODIUM_ASSETS | jq --arg suffix "x64-$LATEST_MS_TAG.tar.gz" 'map(.name) | contains([$suffix])') HAVE_64_TAR=$(echo $VSCODIUM_ASSETS | jq --arg suffix "x64-$LATEST_MS_TAG.tar.gz" 'map(.name) | contains([$suffix])')
@@ -63,6 +123,7 @@ if [ "$GITHUB_TOKEN" != "" ]; then
echo "Already have all the Linux x64 builds" echo "Already have all the Linux x64 builds"
fi fi
fi fi
fi
else else
echo "Release assets do not exist at all, continuing build" echo "Release assets do not exist at all, continuing build"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"

View File

@@ -9,8 +9,6 @@ echo "Got the latest MS tag: ${LATEST_MS_TAG}"
git clone https://github.com/Microsoft/vscode.git --branch $LATEST_MS_TAG --depth 1 git clone https://github.com/Microsoft/vscode.git --branch $LATEST_MS_TAG --depth 1
# for GH actions # for GH actions
if [[ "$CI_WINDOWS" != "True" ]]; then
echo "LATEST_MS_COMMIT=$LATEST_MS_COMMIT" >> $GITHUB_ENV echo "LATEST_MS_COMMIT=$LATEST_MS_COMMIT" >> $GITHUB_ENV
echo "LATEST_MS_TAG=$LATEST_MS_TAG" >> $GITHUB_ENV echo "LATEST_MS_TAG=$LATEST_MS_TAG" >> $GITHUB_ENV
fi

View File

@@ -2,11 +2,6 @@
set -e set -e
if [[ "$CI_WINDOWS" == "True" ]]; then
export npm_config_arch="$BUILDARCH"
export npm_config_target_arch="$BUILDARCH"
fi
cp -rp src/* vscode/ cp -rp src/* vscode/
cd vscode || exit cd vscode || exit
@@ -72,8 +67,8 @@ if [[ "$OS_NAME" == "linux" ]]; then
# fix the packages metadata # fix the packages metadata
# code.appdata.xml # code.appdata.xml
sed -i 's|Visual Studio Code|VSCodium|g' src/resources/linux/code.appdata.xml sed -i 's|Visual Studio Code|VSCodium|g' resources/linux/code.appdata.xml
sed -i 's|https://code.visualstudio.com/docs/setup/linux|https://github.com/VSCodium/vscodium#download-install|' src/resources/linux/code.appdata.xml sed -i 's|https://code.visualstudio.com/docs/setup/linux|https://github.com/VSCodium/vscodium#download-install|' resources/linux/code.appdata.xml
sed -i 's|https://code.visualstudio.com/home/home-screenshot-linux-lg.png|https://vscodium.com/img/vscodium.png|' resources/linux/code.appdata.xml sed -i 's|https://code.visualstudio.com/home/home-screenshot-linux-lg.png|https://vscodium.com/img/vscodium.png|' resources/linux/code.appdata.xml
sed -i 's|https://code.visualstudio.com|https://vscodium.com|' resources/linux/code.appdata.xml sed -i 's|https://code.visualstudio.com|https://vscodium.com|' resources/linux/code.appdata.xml

15
sum.sh
View File

@@ -1,20 +1,11 @@
#!/bin/bash #!/bin/bash
# shasum blows up in Azure, so using this npm install -g checksum
# node package which has similar syntax and identical output
if [[ "$CI_WINDOWS" == "True" ]]; then
npm i -g checksum
fi
sum_file () { sum_file () {
if [[ -f "$1" ]]; then if [[ -f "$1" ]]; then
if [[ "$CI_WINDOWS" == "True" ]]; then
checksum -a sha256 "$1" > "$1".sha256 checksum -a sha256 "$1" > "$1".sha256
checksum -a sha1 "$1" > "$1".sha1 checksum "$1" > "$1".sha1
else
shasum -a 256 "$1" > "$1".sha256
shasum "$1" > "$1".sha1
fi
fi fi
} }
@@ -22,7 +13,7 @@ if [[ "$SHOULD_BUILD" == "yes" ]]; then
if [[ "$OS_NAME" == "osx" ]]; then if [[ "$OS_NAME" == "osx" ]]; then
sum_file VSCodium-darwin-*.zip sum_file VSCodium-darwin-*.zip
sum_file VSCodium*.dmg sum_file VSCodium*.dmg
elif [[ "$CI_WINDOWS" == "True" ]]; then elif [[ "$OS_NAME" == "windows" ]]; then
sum_file VSCodiumSetup-*.exe sum_file VSCodiumSetup-*.exe
sum_file VSCodiumUserSetup-*.exe sum_file VSCodiumUserSetup-*.exe
sum_file VSCodium-win32-*.zip sum_file VSCodium-win32-*.zip

View File

@@ -27,14 +27,8 @@ fi
URL_BASE=https://github.com/VSCodium/vscodium/releases/download/${LATEST_MS_TAG} URL_BASE=https://github.com/VSCodium/vscodium/releases/download/${LATEST_MS_TAG}
# to make testing on forks easier # to make testing on forks easier
if [[ "$CI_WINDOWS" == "True" ]]; then
# BUILD_REPOSITORY_URI = e.g. https://github.com/VSCodium/vscodium
VERSIONS_REPO=$(echo ${BUILD_REPOSITORY_URI} | awk -F"/" '{ print $4 }')/versions
git config --global core.autocrlf true
else
VERSIONS_REPO="${GITHUB_USERNAME}/versions" VERSIONS_REPO="${GITHUB_USERNAME}/versions"
fi echo "Versions repo:" $VERSIONS_REPO
# generateJson <assetName> # generateJson <assetName>
# e.g. generateJson VSCodium-darwin-1.33.0.zip # e.g. generateJson VSCodium-darwin-1.33.0.zip
@@ -103,22 +97,22 @@ if [[ "$OS_NAME" == "osx" ]]; then
VERSION_PATH="darwin/${VSCODE_ARCH}" VERSION_PATH="darwin/${VSCODE_ARCH}"
JSON="$(generateJson ${ASSET_NAME})" JSON="$(generateJson ${ASSET_NAME})"
updateLatestVersion "$VERSION_PATH" "$JSON" updateLatestVersion "$VERSION_PATH" "$JSON"
elif [[ "$CI_WINDOWS" == "True" ]]; then elif [[ "$OS_NAME" == "windows" ]]; then
# system installer # system installer
ASSET_NAME=VSCodiumSetup-${BUILDARCH}-${LATEST_MS_TAG}.exe ASSET_NAME=VSCodiumSetup-${VSCODE_ARCH}-${LATEST_MS_TAG}.exe
VERSION_PATH="win32/${BUILDARCH}/system" VERSION_PATH="win32/${VSCODE_ARCH}/system"
JSON="$(generateJson ${ASSET_NAME})" JSON="$(generateJson ${ASSET_NAME})"
updateLatestVersion "$VERSION_PATH" "$JSON" updateLatestVersion "$VERSION_PATH" "$JSON"
# user installer # user installer
ASSET_NAME=VSCodiumUserSetup-${BUILDARCH}-${LATEST_MS_TAG}.exe ASSET_NAME=VSCodiumUserSetup-${VSCODE_ARCH}-${LATEST_MS_TAG}.exe
VERSION_PATH="win32/${BUILDARCH}/user" VERSION_PATH="win32/${VSCODE_ARCH}/user"
JSON="$(generateJson ${ASSET_NAME})" JSON="$(generateJson ${ASSET_NAME})"
updateLatestVersion "$VERSION_PATH" "$JSON" updateLatestVersion "$VERSION_PATH" "$JSON"
# windows archive # windows archive
ASSET_NAME=VSCodium-win32-${BUILDARCH}-${LATEST_MS_TAG}.zip ASSET_NAME=VSCodium-win32-${VSCODE_ARCH}-${LATEST_MS_TAG}.zip
VERSION_PATH="win32/${BUILDARCH}/archive" VERSION_PATH="win32/${VSCODE_ARCH}/archive"
JSON="$(generateJson ${ASSET_NAME})" JSON="$(generateJson ${ASSET_NAME})"
updateLatestVersion "$VERSION_PATH" "$JSON" updateLatestVersion "$VERSION_PATH" "$JSON"
else # linux else # linux

View File

@@ -1,61 +0,0 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "12.14.1"
- task: UsePythonVersion@0
displayName: 'Use Python 2.x'
inputs:
versionSpec: 2.x
- task: ShellScript@2
displayName: 'get VSCode sources'
inputs:
scriptPath: get_repo.sh
- powershell: |
$LATEST_MS_COMMIT="$(git -C vscode rev-list --tags --max-count=1)"
$LATEST_MS_TAG="$(git -C vscode describe --tags)"
Write-Host "##vso[task.setvariable variable=LATEST_MS_TAG]$LATEST_MS_TAG"
Write-Host "##vso[task.setvariable variable=LATEST_MS_COMMIT]$LATEST_MS_COMMIT"
Write-Host "##vso[task.setvariable variable=BUILD_SOURCEVERSION]$LATEST_MS_COMMIT"
displayName: 'set env LATEST_MS_TAG, LATEST_MS_COMMIT'
- task: PowerShell@2
inputs:
filePath: 'check_tags.ps1'
env:
MAPPED_GITHUB_TOKEN: $(GITHUB_TOKEN)
- powershell: |
bash ./build.sh
displayName: 'go build it!'
- bash: |
if [[ "$SHOULD_BUILD" == "yes" ]]; then mv vscode\\.build\\win32-$(BUILDARCH)\\system-setup\\VSCodeSetup.exe VSCodiumSetup-$(BUILDARCH)-${LATEST_MS_TAG}.exe; fi
displayName: 'move the system setup'
- bash: |
if [[ "$SHOULD_BUILD" == "yes" ]]; then mv vscode\\.build\\win32-$(BUILDARCH)\\user-setup\\VSCodeSetup.exe VSCodiumUserSetup-$(BUILDARCH)-${LATEST_MS_TAG}.exe; fi
displayName: 'move the user setup'
- bash: |
if [[ "$SHOULD_BUILD" == "yes" ]]; then mv vscode\\.build\\win32-$(BUILDARCH)\\archive\\VSCode-win32-$(BUILDARCH).zip VSCodium-win32-$(BUILDARCH)-${LATEST_MS_TAG}.zip; fi
displayName: 'move the zip folder'
- powershell: |
bash ./sum.sh
condition: eq(variables['SHOULD_BUILD'], 'yes')
displayName: 'compute sums'
- task: CopyFiles@2
inputs:
contents: |
VSCodium*.zip
VSCodiumUserSetup*.exe
VSCodiumSetup*.exe
*.sha256
targetFolder: $(Build.ArtifactStagingDirectory)
condition: eq(variables['SHOULD_BUILD'], 'yes')
displayName: 'copy artifacts to staging directory'
- task: PublishBuildArtifacts@1
displayName: 'Publish artifacts'
condition: eq(variables['SHOULD_BUILD'], 'yes')
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)
ArtifactName: 'everything'
- bash: ./update_version.sh
displayName: 'update version json'
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
GITHUB_USERNAME: $(GITHUB_USERNAME)