feat: make build more generic (#1279)

This commit is contained in:
Baptiste Augrain 2022-10-06 22:15:41 +02:00 committed by GitHub
parent 6cb5e52ffe
commit fed608b13e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 171 additions and 155 deletions

View File

@ -23,9 +23,12 @@ jobs:
container:
image: ${{ matrix.image }}
env:
OS_NAME: 'linux'
APP_NAME: VSCodium
ASSETS_REPOSITORY: ${{ github.repository }}-insiders
VERSIONS_REPOSITORY: ${{ github.repository_owner }}/versions
OS_NAME: linux
VSCODE_ARCH: ${{ matrix.vscode_arch }}
VSCODE_QUALITY: 'insider'
VSCODE_QUALITY: insider
strategy:
fail-fast: false
matrix:
@ -98,8 +101,8 @@ jobs:
run: ./build.sh
if: env.SHOULD_BUILD == 'yes'
- name: Prepare artifacts
run: ./prepare_artifacts.sh
- name: Prepare assets
run: ./prepare_assets.sh
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
- name: Release
@ -149,6 +152,8 @@ jobs:
needs: build
runs-on: ubuntu-latest
env:
APP_NAME: codium
ASSETS_REPOSITORY: ${{ github.repository }}-insiders
VSCODE_QUALITY: 'insider'
strategy:
fail-fast: false

View File

@ -21,9 +21,12 @@ jobs:
build:
runs-on: ${{ matrix.runner }}
env:
OS_NAME: 'osx'
APP_NAME: VSCodium
ASSETS_REPOSITORY: ${{ github.repository }}-insiders
VERSIONS_REPOSITORY: ${{ github.repository_owner }}/versions
OS_NAME: osx
VSCODE_ARCH: ${{ matrix.vscode_arch }}
VSCODE_QUALITY: 'insider'
VSCODE_QUALITY: insider
strategy:
fail-fast: false
matrix:
@ -81,12 +84,12 @@ jobs:
run: ./build.sh
if: env.SHOULD_BUILD == 'yes'
- name: Prepare artifacts
- name: Prepare assets
env:
CERTIFICATE_OSX_P12: ${{ secrets.CERTIFICATE_OSX_P12 }}
CERTIFICATE_OSX_PASSWORD: ${{ secrets.CERTIFICATE_OSX_PASSWORD }}
CERTIFICATE_OSX_ID: ${{ secrets.CERTIFICATE_OSX_ID }}
run: ./prepare_artifacts.sh
run: ./prepare_assets.sh
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
- name: Release

View File

@ -9,10 +9,13 @@ jobs:
build:
runs-on: [self-hosted, macOS, ARM64]
env:
OS_NAME: 'osx'
VSCODE_ARCH: 'arm64'
VSCODE_LATEST: 'yes'
VSCODE_QUALITY: 'insider'
APP_NAME: VSCodium
ASSETS_REPOSITORY: ${{ github.repository }}-insiders
VERSIONS_REPOSITORY: ${{ github.repository_owner }}/versions
OS_NAME: osx
VSCODE_ARCH: arm64
VSCODE_LATEST: yes
VSCODE_QUALITY: insider
steps:
- uses: actions/checkout@v3

View File

@ -24,9 +24,12 @@ jobs:
run:
shell: bash
env:
OS_NAME: 'windows'
APP_NAME: VSCodium
ASSETS_REPOSITORY: ${{ github.repository }}-insiders
VERSIONS_REPOSITORY: ${{ github.repository_owner }}/versions
OS_NAME: windows
VSCODE_ARCH: ${{ matrix.vscode_arch }}
VSCODE_QUALITY: 'insider'
VSCODE_QUALITY: insider
strategy:
fail-fast: false
matrix:
@ -96,8 +99,8 @@ jobs:
run: ./build.sh
if: env.SHOULD_BUILD == 'yes'
- name: Prepare artifacts
run: ./prepare_artifacts.sh
- name: Prepare assets
run: ./prepare_assets.sh
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
- name: Release
@ -121,6 +124,7 @@ jobs:
run:
shell: bash
env:
APP_IDENTIFIER: VSCodium.VSCodium.Insiders
VSCODE_QUALITY: 'insider'
if: needs.build.outputs.SHOULD_DEPLOY == 'yes'
@ -137,7 +141,7 @@ jobs:
- name: Release to WinGet
uses: vedantmgoyal2009/winget-releaser@latest
with:
identifier: VSCodium.VSCodium.Insiders
identifier: ${{ env.APP_IDENTIFIER }}
version: ${{ env.RELEASE_VERSION }}
release-repository: vscodium-insiders
release-tag: ${{ env.RELEASE_VERSION }}-insider

View File

@ -23,9 +23,12 @@ jobs:
container:
image: ${{ matrix.image }}
env:
OS_NAME: 'linux'
APP_NAME: VSCodium
ASSETS_REPOSITORY: ${{ github.repository }}
VERSIONS_REPOSITORY: ${{ github.repository_owner }}/versions
OS_NAME: linux
VSCODE_ARCH: ${{ matrix.vscode_arch }}
VSCODE_QUALITY: 'stable'
VSCODE_QUALITY: stable
strategy:
fail-fast: false
matrix:
@ -95,8 +98,8 @@ jobs:
run: ./build.sh
if: env.SHOULD_BUILD == 'yes'
- name: Prepare artifacts
run: ./prepare_artifacts.sh
- name: Prepare assets
run: ./prepare_assets.sh
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
- name: Release
@ -145,6 +148,9 @@ jobs:
snap:
needs: build
runs-on: ubuntu-latest
env:
APP_NAME: codium
ASSETS_REPOSITORY: ${{ github.repository }}
strategy:
fail-fast: false
matrix:

View File

@ -21,9 +21,12 @@ jobs:
build:
runs-on: ${{ matrix.runner }}
env:
OS_NAME: 'osx'
APP_NAME: VSCodium
ASSETS_REPOSITORY: ${{ github.repository }}
VERSIONS_REPOSITORY: ${{ github.repository_owner }}/versions
OS_NAME: osx
VSCODE_ARCH: ${{ matrix.vscode_arch }}
VSCODE_QUALITY: 'stable'
VSCODE_QUALITY: stable
strategy:
fail-fast: false
matrix:
@ -78,12 +81,12 @@ jobs:
run: ./build.sh
if: env.SHOULD_BUILD == 'yes'
- name: Prepare artifacts
- name: Prepare assets
env:
CERTIFICATE_OSX_P12: ${{ secrets.CERTIFICATE_OSX_P12 }}
CERTIFICATE_OSX_PASSWORD: ${{ secrets.CERTIFICATE_OSX_PASSWORD }}
CERTIFICATE_OSX_ID: ${{ secrets.CERTIFICATE_OSX_ID }}
run: ./prepare_artifacts.sh
run: ./prepare_assets.sh
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
- name: Release

View File

@ -24,9 +24,12 @@ jobs:
run:
shell: bash
env:
OS_NAME: 'windows'
APP_NAME: VSCodium
ASSETS_REPOSITORY: ${{ github.repository }}
VERSIONS_REPOSITORY: ${{ github.repository_owner }}/versions
OS_NAME: windows
VSCODE_ARCH: ${{ matrix.vscode_arch }}
VSCODE_QUALITY: 'stable'
VSCODE_QUALITY: stable
strategy:
fail-fast: false
matrix:
@ -93,8 +96,8 @@ jobs:
run: ./build.sh
if: env.SHOULD_BUILD == 'yes'
- name: Prepare artifacts
run: ./prepare_artifacts.sh
- name: Prepare assets
run: ./prepare_assets.sh
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
- name: Release
@ -116,6 +119,8 @@ jobs:
defaults:
run:
shell: bash
env:
APP_IDENTIFIER: VSCodium.VSCodium
if: needs.build.outputs.SHOULD_DEPLOY == 'yes'
steps:
@ -127,9 +132,10 @@ jobs:
RELEASE_VERSION: ${{ needs.build.outputs.RELEASE_VERSION }}
- name: Release to WinGet
uses: vedantmgoyal2009/winget-releaser@latest
uses: daiyam/winget-releaser@insider
with:
identifier: VSCodium.VSCodium
identifier: ${{ env.APP_IDENTIFIER }}
version: ${{ env.RELEASE_VERSION }}
release-tag: ${{ env.RELEASE_VERSION }}
installers-regex: '\.exe$' # only .exe files
token: ${{ secrets.STRONGER_GITHUB_TOKEN }}

2
.gitignore vendored
View File

@ -4,7 +4,7 @@ VSCode*
VSCodium*
.DS_Store
*.env
artifacts/
assets/
build/linux/appimage/out
build/linux/appimage/pkg2appimage.AppDir
build/linux/appimage/pkg2appimage-*.AppImage

View File

@ -4,10 +4,11 @@
# to run with Bash: "C:\Program Files\Git\bin\bash.exe" ./build/build.sh
###
export APP_NAME="VSCodium"
export CI_BUILD="no"
export SHOULD_BUILD="yes"
export SKIP_BUILD="no"
export SKIP_PACKAGES="yes"
export SKIP_ASSETS="yes"
export VSCODE_LATEST="no"
export VSCODE_QUALITY="stable"
@ -23,7 +24,7 @@ while getopts ":ilop" opt; do
export SKIP_BUILD="yes"
;;
p)
export SKIP_PACKAGES="no"
export SKIP_ASSETS="no"
;;
esac
done
@ -50,7 +51,7 @@ fi
echo "OS_NAME=\"${OS_NAME}\""
echo "SKIP_BUILD=\"${SKIP_BUILD}\""
echo "SKIP_PACKAGES=\"${SKIP_PACKAGES}\""
echo "SKIP_ASSETS=\"${SKIP_ASSETS}\""
echo "VSCODE_ARCH=\"${VSCODE_ARCH}\""
echo "VSCODE_LATEST=\"${VSCODE_LATEST}\""
echo "VSCODE_QUALITY=\"${VSCODE_QUALITY}\""
@ -80,10 +81,10 @@ else
echo "BUILD_SOURCEVERSION=\"${BUILD_SOURCEVERSION}\""
fi
if [[ "${SKIP_PACKAGES}" == "no" ]]; then
if [[ "${SKIP_ASSETS}" == "no" ]]; then
if [[ "${OS_NAME}" == "windows" ]]; then
rm -rf build/windows/msi/releasedir
fi
. prepare_artifacts.sh
. prepare_assets.sh
fi

View File

@ -2,10 +2,11 @@
exists() { type -t "$1" > /dev/null 2>&1; }
export APP_NAME="VSCodium"
export CI_BUILD="no"
export OS_NAME="linux"
export SHOULD_BUILD="yes"
export SKIP_PACKAGES="yes"
export SKIP_ASSETS="yes"
export VSCODE_LATEST="no"
export VSCODE_QUALITY="stable"
@ -18,7 +19,7 @@ while getopts ":ilp" opt; do
export VSCODE_LATEST="yes"
;;
p)
export SKIP_PACKAGES="no"
export SKIP_ASSETS="no"
;;
esac
done
@ -41,7 +42,7 @@ else
fi
echo "OS_NAME=\"${OS_NAME}\""
echo "SKIP_PACKAGES=\"${SKIP_PACKAGES}\""
echo "SKIP_ASSETS=\"${SKIP_ASSETS}\""
echo "VSCODE_ARCH=\"${VSCODE_ARCH}\""
echo "VSCODE_LATEST=\"${VSCODE_LATEST}\""
echo "VSCODE_QUALITY=\"${VSCODE_QUALITY}\""
@ -51,6 +52,6 @@ rm -rf vscode* VSCode*
. get_repo.sh
. build.sh
if [[ "${SKIP_PACKAGES}" == "no" ]]; then
. prepare_artifacts.sh
if [[ "${SKIP_ASSETS}" == "no" ]]; then
. prepare_assets.sh
fi

View File

@ -7,13 +7,8 @@ if [[ -z "${GITHUB_TOKEN}" ]]; then
exit
fi
if [[ "${VSCODE_QUALITY}" == "insider" ]]; then
REPOSITORY="${GITHUB_REPOSITORY:-"VSCodium/vscodium"}-insiders"
else
REPOSITORY="${GITHUB_REPOSITORY:-"VSCodium/vscodium"}"
fi
GITHUB_RESPONSE=$( curl -s -H "Authorization: token ${GITHUB_TOKEN}" "https://api.github.com/repos/${REPOSITORY}/releases/latest" )
APP_NAME_LC=$( echo "${APP_NAME}" | awk '{print tolower($0)}' )
GITHUB_RESPONSE=$( curl -s -H "Authorization: token ${GITHUB_TOKEN}" "https://api.github.com/repos/${ASSETS_REPOSITORY}/releases/latest" )
LATEST_VERSION=$( echo "${GITHUB_RESPONSE}" | jq -c -r '.tag_name' )
if [[ "${LATEST_VERSION}" =~ ^([0-9]+\.[0-9]+\.[0-9]+) ]]; then
@ -40,29 +35,29 @@ if [[ "${LATEST_VERSION}" =~ ^([0-9]+\.[0-9]+\.[0-9]+) ]]; then
echo "Switch to release version: ${RELEASE_VERSION}"
VSCODIUM_ASSETS=$( echo "${GITHUB_RESPONSE}" | jq -c '.assets | map(.name)?' )
ASSETS=$( echo "${GITHUB_RESPONSE}" | jq -c '.assets | map(.name)?' )
else
VSCODIUM_ASSETS="null"
ASSETS="null"
fi
fi
contains() {
# add " to match the end of a string so any hashs won't be matched by mistake
echo "${VSCODIUM_ASSETS}" | grep "${1}\""
echo "${ASSETS}" | grep "${1}\""
}
if [ "${VSCODIUM_ASSETS}" != "null" ]; then
if [ "${ASSETS}" != "null" ]; then
# macos
if [[ "${OS_NAME}" == "osx" ]]; then
if [[ "${VSCODE_QUALITY}" == "insider" && "${VSCODE_ARCH}" == "arm64" ]]; then
if [[ -z $( contains "VSCodium-${RELEASE_VERSION}-src.tar.gz" ) || -z $( contains "VSCodium-${RELEASE_VERSION}-src.zip" ) ]]; then
if [[ -z $( contains "${APP_NAME}-${RELEASE_VERSION}-src.tar.gz" ) || -z $( contains "${APP_NAME}-${RELEASE_VERSION}-src.zip" ) ]]; then
echo "Building on MacOS because we have no SRC"
export SHOULD_BUILD="yes"
export SHOULD_BUILD_SRC="yes"
fi
fi
if [[ -z $( contains "VSCodium-darwin-${VSCODE_ARCH}-${RELEASE_VERSION}.zip" ) ]]; then
if [[ -z $( contains "${APP_NAME}-darwin-${VSCODE_ARCH}-${RELEASE_VERSION}.zip" ) ]]; then
echo "Building on MacOS because we have no ZIP"
export SHOULD_BUILD="yes"
else
@ -76,7 +71,7 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
export SHOULD_BUILD_DMG="no"
fi
if [[ -z $( contains "vscodium-reh-darwin-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" ) ]]; then
if [[ -z $( contains "${APP_NAME_LC}-reh-darwin-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" ) ]]; then
echo "Building on MacOS because we have no REH archive"
export SHOULD_BUILD="yes"
else
@ -90,7 +85,7 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
# windows-arm64
if [[ "${VSCODE_ARCH}" == "arm64" ]]; then
if [[ -z $( contains "VSCodiumSetup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe" ) ]]; then
if [[ -z $( contains "${APP_NAME}Setup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe" ) ]]; then
echo "Building on Windows arm64 because we have no system setup"
export SHOULD_BUILD="yes"
else
@ -104,7 +99,7 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
export SHOULD_BUILD_EXE_USR="no"
fi
if [[ -z $( contains "VSCodium-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.zip" ) ]]; then
if [[ -z $( contains "${APP_NAME}-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.zip" ) ]]; then
echo "Building on Windows arm64 because we have no zip"
export SHOULD_BUILD="yes"
else
@ -119,7 +114,7 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
# windows-ia32
elif [[ "${VSCODE_ARCH}" == "ia32" ]]; then
if [[ -z $( contains "VSCodiumSetup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe" ) ]]; then
if [[ -z $( contains "${APP_NAME}Setup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe" ) ]]; then
echo "Building on Windows ia32 because we have no system setup"
export SHOULD_BUILD="yes"
else
@ -133,28 +128,28 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
export SHOULD_BUILD_EXE_USR="no"
fi
if [[ -z $( contains "VSCodium-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.zip" ) ]]; then
if [[ -z $( contains "${APP_NAME}-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.zip" ) ]]; then
echo "Building on Windows ia32 because we have no zip"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_ZIP="no"
fi
if [[ -z $( contains "VSCodium-${VSCODE_ARCH}-${RELEASE_VERSION}.msi" ) ]]; then
if [[ -z $( contains "${APP_NAME}-${VSCODE_ARCH}-${RELEASE_VERSION}.msi" ) ]]; then
echo "Building on Windows ia32 because we have no msi"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_MSI="no"
fi
if [[ -z $( contains "VSCodium-${VSCODE_ARCH}-updates-disabled-${RELEASE_VERSION}.msi" ) ]]; then
if [[ -z $( contains "${APP_NAME}-${VSCODE_ARCH}-updates-disabled-${RELEASE_VERSION}.msi" ) ]]; then
echo "Building on Windows ia32 because we have no updates-disabled msi"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_MSI_NOUP="no"
fi
if [[ -z $( contains "vscodium-reh-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" ) ]]; then
if [[ -z $( contains "${APP_NAME_LC}-reh-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" ) ]]; then
echo "Building on Windows ia32 because we have no REH archive"
export SHOULD_BUILD="yes"
else
@ -167,7 +162,7 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
# windows-x64
else
if [[ -z $( contains "VSCodiumSetup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe" ) ]]; then
if [[ -z $( contains "${APP_NAME}Setup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe" ) ]]; then
echo "Building on Windows x64 because we have no system setup"
export SHOULD_BUILD="yes"
else
@ -181,28 +176,28 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
export SHOULD_BUILD_EXE_USR="no"
fi
if [[ -z $( contains "VSCodium-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.zip" ) ]]; then
if [[ -z $( contains "${APP_NAME}-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.zip" ) ]]; then
echo "Building on Windows x64 because we have no zip"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_ZIP="no"
fi
if [[ -z $( contains "VSCodium-${VSCODE_ARCH}-${RELEASE_VERSION}.msi" ) ]]; then
if [[ -z $( contains "${APP_NAME}-${VSCODE_ARCH}-${RELEASE_VERSION}.msi" ) ]]; then
echo "Building on Windows x64 because we have no msi"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_MSI="no"
fi
if [[ -z $( contains "VSCodium-${VSCODE_ARCH}-updates-disabled-${RELEASE_VERSION}.msi" ) ]]; then
if [[ -z $( contains "${APP_NAME}-${VSCODE_ARCH}-updates-disabled-${RELEASE_VERSION}.msi" ) ]]; then
echo "Building on Windows x64 because we have no updates-disabled msi"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_MSI_NOUP="no"
fi
if [[ -z $( contains "vscodium-reh-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" ) ]]; then
if [[ -z $( contains "${APP_NAME_LC}-reh-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" ) ]]; then
echo "Building on Windows x64 because we have no REH archive"
export SHOULD_BUILD="yes"
else
@ -231,14 +226,14 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
export SHOULD_BUILD_RPM="no"
fi
if [[ -z $( contains "VSCodium-linux-arm64-${RELEASE_VERSION}.tar.gz" ) ]]; then
if [[ -z $( contains "${APP_NAME}-linux-arm64-${RELEASE_VERSION}.tar.gz" ) ]]; then
echo "Building on Linux arm64 because we have no TAR"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_TAR="no"
fi
if [[ -z $( contains "vscodium-reh-linux-arm64-${RELEASE_VERSION}.tar.gz" ) ]]; then
if [[ -z $( contains "${APP_NAME_LC}-reh-linux-arm64-${RELEASE_VERSION}.tar.gz" ) ]]; then
echo "Building on Linux arm64 because we have no REH archive"
export SHOULD_BUILD="yes"
else
@ -267,14 +262,14 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
export SHOULD_BUILD_RPM="no"
fi
if [[ -z $( contains "VSCodium-linux-armhf-${RELEASE_VERSION}.tar.gz" ) ]]; then
if [[ -z $( contains "${APP_NAME}-linux-armhf-${RELEASE_VERSION}.tar.gz" ) ]]; then
echo "Building on Linux arm because we have no TAR"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_TAR="no"
fi
if [[ -z $( contains "vscodium-reh-linux-armhf-${RELEASE_VERSION}.tar.gz" ) ]]; then
if [[ -z $( contains "${APP_NAME_LC}-reh-linux-armhf-${RELEASE_VERSION}.tar.gz" ) ]]; then
echo "Building on Linux arm because we have no REH archive"
export SHOULD_BUILD="yes"
else
@ -303,7 +298,7 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
export SHOULD_BUILD_RPM="no"
fi
if [[ -z $( contains "VSCodium-linux-x64-${RELEASE_VERSION}.tar.gz" ) ]]; then
if [[ -z $( contains "${APP_NAME}-linux-x64-${RELEASE_VERSION}.tar.gz" ) ]]; then
echo "Building on Linux x64 because we have no TAR"
export SHOULD_BUILD="yes"
else
@ -317,7 +312,7 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
export SHOULD_BUILD_APPIMAGE="no"
fi
if [[ -z $( contains "vscodium-reh-linux-x64-${RELEASE_VERSION}.tar.gz" ) ]]; then
if [[ -z $( contains "${APP_NAME_LC}-reh-linux-x64-${RELEASE_VERSION}.tar.gz" ) ]]; then
echo "Building on Linux x64 because we have no REH archive"
export SHOULD_BUILD="yes"
else

View File

@ -4,7 +4,7 @@ set -e
# git workaround
if [[ "${CI_BUILD}" != "no" ]]; then
git config --global --add safe.directory /__w/vscodium/vscodium
git config --global --add safe.directory "/__w/$( echo "${GITHUB_REPOSITORY}" | awk '{print tolower($0)}' )"
fi
if [[ -z "${RELEASE_VERSION}" ]]; then

View File

@ -2,6 +2,8 @@
set -e
APP_NAME_LC=$( echo "${APP_NAME}" | awk '{print tolower($0)}' )
npm install -g checksum
sum_file() {
@ -12,13 +14,13 @@ sum_file() {
fi
}
mkdir -p artifacts
mkdir -p assets
if [[ "${OS_NAME}" == "osx" ]]; then
if [[ "${CI_BUILD}" != "no" ]]; then
cd "VSCode-darwin-${VSCODE_ARCH}"
CERTIFICATE_P12=VSCodium.p12
CERTIFICATE_P12="${APP_NAME}.p12"
KEYCHAIN="${RUNNER_TEMP}/build.keychain"
echo "${CERTIFICATE_OSX_P12}" | base64 --decode > "${CERTIFICATE_P12}"
@ -38,9 +40,9 @@ if [[ "${OS_NAME}" == "osx" ]]; then
echo "+ signing"
if [[ "${VSCODE_QUALITY}" == "insider" ]]; then
codesign --deep --force --verbose --sign "${CERTIFICATE_OSX_ID}" "VSCodium - Insiders.app"
codesign --deep --force --verbose --sign "${CERTIFICATE_OSX_ID}" "${APP_NAME} - Insiders.app"
else
codesign --deep --force --verbose --sign "${CERTIFICATE_OSX_ID}" "VSCodium.app"
codesign --deep --force --verbose --sign "${CERTIFICATE_OSX_ID}" "${APP_NAME}.app"
fi
cd ..
@ -49,7 +51,7 @@ if [[ "${OS_NAME}" == "osx" ]]; then
if [[ "${SHOULD_BUILD_ZIP}" != "no" ]]; then
echo "Building and moving ZIP"
cd "VSCode-darwin-${VSCODE_ARCH}"
zip -r -X -y "../artifacts/VSCodium-darwin-${VSCODE_ARCH}-${RELEASE_VERSION}.zip" ./*.app
zip -r -X -y "../assets/${APP_NAME}-darwin-${VSCODE_ARCH}-${RELEASE_VERSION}.zip" ./*.app
cd ..
fi
@ -57,13 +59,13 @@ if [[ "${OS_NAME}" == "osx" ]]; then
echo "Building and moving DMG"
pushd "VSCode-darwin-${VSCODE_ARCH}"
npx create-dmg ./*.app ..
mv ../*.dmg "../artifacts/VSCodium.${VSCODE_ARCH}.${RELEASE_VERSION}.dmg"
mv ../*.dmg "../assets/${APP_NAME}.${VSCODE_ARCH}.${RELEASE_VERSION}.dmg"
popd
fi
if [[ "${SHOULD_BUILD_SRC}" == "yes" ]]; then
git archive --format tar.gz --output="./artifacts/VSCodium-${RELEASE_VERSION}-src.tar.gz" HEAD
git archive --format zip --output="./artifacts/VSCodium-${RELEASE_VERSION}-src.zip" HEAD
git archive --format tar.gz --output="./assets/${APP_NAME}-${RELEASE_VERSION}-src.tar.gz" HEAD
git archive --format zip --output="./assets/${APP_NAME}-${RELEASE_VERSION}-src.zip" HEAD
fi
VSCODE_PLATFORM="darwin"
@ -98,28 +100,28 @@ elif [[ "${OS_NAME}" == "windows" ]]; then
if [[ "${SHOULD_BUILD_ZIP}" != "no" ]]; then
echo "Moving ZIP"
mv "vscode\\.build\\win32-${VSCODE_ARCH}\\archive\\VSCode-win32-${VSCODE_ARCH}.zip" "artifacts\\VSCodium-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.zip"
mv "vscode\\.build\\win32-${VSCODE_ARCH}\\archive\\VSCode-win32-${VSCODE_ARCH}.zip" "assets\\${APP_NAME}-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.zip"
fi
if [[ "${SHOULD_BUILD_EXE_SYS}" != "no" ]]; then
echo "Moving System EXE"
mv "vscode\\.build\\win32-${VSCODE_ARCH}\\system-setup\\VSCodeSetup.exe" "artifacts\\VSCodiumSetup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe"
mv "vscode\\.build\\win32-${VSCODE_ARCH}\\system-setup\\VSCodeSetup.exe" "assets\\${APP_NAME}Setup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe"
fi
if [[ "${SHOULD_BUILD_EXE_USR}" != "no" ]]; then
echo "Moving User EXE"
mv "vscode\\.build\\win32-${VSCODE_ARCH}\\user-setup\\VSCodeSetup.exe" "artifacts\\VSCodiumUserSetup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe"
mv "vscode\\.build\\win32-${VSCODE_ARCH}\\user-setup\\VSCodeSetup.exe" "assets\\${APP_NAME}UserSetup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe"
fi
if [[ "${VSCODE_ARCH}" == "ia32" || "${VSCODE_ARCH}" == "x64" ]]; then
if [[ "${SHOULD_BUILD_MSI}" != "no" ]]; then
echo "Moving MSI"
mv "build\\windows\\msi\\releasedir\\VSCodium-${VSCODE_ARCH}-${RELEASE_VERSION}.msi" artifacts/
mv "build\\windows\\msi\\releasedir\\${APP_NAME}-${VSCODE_ARCH}-${RELEASE_VERSION}.msi" assets/
fi
if [[ "${SHOULD_BUILD_MSI_NOUP}" != "no" ]]; then
echo "Moving MSI with disabled updates"
mv "build\\windows\\msi\\releasedir\\VSCodium-${VSCODE_ARCH}-updates-disabled-${RELEASE_VERSION}.msi" artifacts/
mv "build\\windows\\msi\\releasedir\\${APP_NAME}-${VSCODE_ARCH}-updates-disabled-${RELEASE_VERSION}.msi" assets/
fi
fi
@ -144,25 +146,25 @@ else
if [[ "${SHOULD_BUILD_TAR}" != "no" ]]; then
echo "Building and moving TAR"
cd "VSCode-linux-${VSCODE_ARCH}"
tar czf "../artifacts/VSCodium-linux-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" .
tar czf "../assets/${APP_NAME}-linux-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" .
cd ..
fi
if [[ "${SHOULD_BUILD_DEB}" != "no" ]]; then
echo "Moving DEB"
mv vscode/.build/linux/deb/*/deb/*.deb artifacts/
mv vscode/.build/linux/deb/*/deb/*.deb assets/
fi
if [[ "${SHOULD_BUILD_RPM}" != "no" ]]; then
echo "Moving RPM"
mv vscode/.build/linux/rpm/*/*.rpm artifacts/
mv vscode/.build/linux/rpm/*/*.rpm assets/
fi
if [[ "${SHOULD_BUILD_APPIMAGE}" != "no" ]]; then
echo "Moving AppImage"
mv build/linux/appimage/out/*.AppImage* artifacts/
mv build/linux/appimage/out/*.AppImage* assets/
find artifacts -name '*.AppImage*' -exec bash -c 'mv $0 ${0/_-_/-}' {} \;
find assets -name '*.AppImage*' -exec bash -c 'mv $0 ${0/_-_/-}' {} \;
fi
VSCODE_PLATFORM="linux"
@ -171,11 +173,11 @@ fi
if [[ "${SHOULD_BUILD_REH}" != "no" ]]; then
echo "Building and moving REH"
cd "vscode-reh-${VSCODE_PLATFORM}-${VSCODE_ARCH}"
tar czf "../artifacts/vscodium-reh-${VSCODE_PLATFORM}-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" .
tar czf "../assets/${APP_NAME_LC}-reh-${VSCODE_PLATFORM}-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" .
cd ..
fi
cd artifacts
cd assets
for FILE in *
do

View File

@ -7,27 +7,26 @@ if [[ -z "${GITHUB_TOKEN}" ]]; then
exit
fi
OWNER="${GITHUB_REPOSITORY_OWNER:-"VSCodium"}"
REPO_NAME="${GITHUB_REPOSITORY:(${#OWNER}+1)}"
if [[ "${VSCODE_QUALITY}" == "insider" ]]; then
REPOSITORY="${REPO_NAME:-"vscodium"}-insiders"
NOTES="update vscode to [${MS_COMMIT}](https://github.com/microsoft/vscode/tree/${MS_COMMIT})"
CREATE_OPTIONS=""
else
REPOSITORY="${REPO_NAME:-"vscodium"}"
NOTES="update vscode to [${MS_TAG}](https://code.visualstudio.com/updates/v$( echo ${MS_TAG//./_} | cut -d'_' -f 1,2 ))"
CREATE_OPTIONS="--generate-notes"
fi
REPOSITORY_OWNER="${ASSETS_REPOSITORY/\/*/}"
REPOSITORY_NAME="${ASSETS_REPOSITORY/*\//}"
npm install -g github-release-cli
if [[ $( gh release view --repo "${OWNER}/${REPOSITORY}" "${RELEASE_VERSION}" 2>&1 ) =~ "release not found" ]]; then
if [[ $( gh release view --repo "${ASSETS_REPOSITORY}" "${RELEASE_VERSION}" 2>&1 ) =~ "release not found" ]]; then
echo "Creating release '${RELEASE_VERSION}'"
gh release create "${RELEASE_VERSION}" --repo "${OWNER}/${REPOSITORY}" --notes "${NOTES}" ${CREATE_OPTIONS}
if [[ "${VSCODE_QUALITY}" == "insider" ]]; then
NOTES="update vscode to [${MS_COMMIT}](https://github.com/microsoft/vscode/tree/${MS_COMMIT})"
CREATE_OPTIONS=""
else
NOTES="update vscode to [${MS_TAG}](https://code.visualstudio.com/updates/v$( echo ${MS_TAG//./_} | cut -d'_' -f 1,2 ))"
CREATE_OPTIONS="--generate-notes"
fi
gh release create "${RELEASE_VERSION}" --repo "${ASSETS_REPOSITORY}" --notes "${NOTES}" ${CREATE_OPTIONS}
fi
cd artifacts
cd assets
set +e
@ -35,7 +34,7 @@ for FILE in *
do
if [[ -f "${FILE}" ]] && [[ "${FILE}" != *.sha1 ]] && [[ "${FILE}" != *.sha256 ]]; then
echo "::group::Uploading '${FILE}' at $( date "+%T" )"
gh release upload --repo "${OWNER}/${REPOSITORY}" "${RELEASE_VERSION}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
gh release upload --repo "${ASSETS_REPOSITORY}" "${RELEASE_VERSION}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
EXIT_STATUS=$?
echo "exit: ${EXIT_STATUS}"
@ -43,12 +42,12 @@ do
if (( "${EXIT_STATUS}" )); then
for (( i=0; i<10; i++ ))
do
github-release delete --owner "${OWNER}" --repo "${REPOSITORY}" --tag "${RELEASE_VERSION}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
github-release delete --owner "${REPOSITORY_OWNER}" --repo "${REPOSITORY_NAME}" --tag "${RELEASE_VERSION}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
sleep $(( 15 * (i + 1)))
echo "RE-Uploading '${FILE}' at $( date "+%T" )"
gh release upload --repo "${OWNER}/${REPOSITORY}" "${RELEASE_VERSION}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
gh release upload --repo "${ASSETS_REPOSITORY}" "${RELEASE_VERSION}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
EXIT_STATUS=$?
echo "exit: ${EXIT_STATUS}"
@ -62,7 +61,7 @@ do
if (( "${EXIT_STATUS}" )); then
echo "'${FILE}' hasn't been uploaded!"
github-release delete --owner "${OWNER}" --repo "${REPOSITORY}" --tag "${RELEASE_VERSION}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
github-release delete --owner "${REPOSITORY_OWNER}" --repo "${REPOSITORY_NAME}" --tag "${RELEASE_VERSION}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
exit 1
fi

View File

@ -3,11 +3,9 @@
set -e
if [[ "${VSCODE_QUALITY}" == "insider" ]]; then
REPOSITORY="${GITHUB_REPOSITORY:-"VSCodium/vscodium"}-insiders"
SNAP_NAME="codium-insiders"
SNAP_NAME="${APP_NAME}-insiders"
else
REPOSITORY="${GITHUB_REPOSITORY:-"VSCodium/vscodium"}"
SNAP_NAME="codium"
SNAP_NAME="${APP_NAME}"
fi
sudo snap install --channel stable --classic snapcraft
@ -17,7 +15,7 @@ echo "Architecture: ${ARCHITECTURE}"
SNAP_VERSION=$(snapcraft list-revisions ${SNAP_NAME} | grep -F "stable*" | grep "${ARCHITECTURE}" | tr -s ' ' | cut -d ' ' -f 4)
echo "Snap version: ${SNAP_VERSION}"
wget --quiet "https://api.github.com/repos/${REPOSITORY}/releases" -O gh_latest.json
wget --quiet "https://api.github.com/repos/${ASSETS_REPOSITORY}/releases" -O gh_latest.json
GH_VERSION=$(jq -r 'sort_by(.tag_name)|last.tag_name' gh_latest.json)
echo "GH version: ${GH_VERSION}"

View File

@ -2,12 +2,10 @@
set -e
if [[ "${VSCODE_QUALITY}" == "insider" ]]; then
VERSIONS=$( curl --silent https://api.github.com/repos/microsoft/winget-pkgs/contents/manifests/v/VSCodium/VSCodium/Insiders )
VERSIONS=$( curl --silent "https://api.github.com/repos/microsoft/winget-pkgs/contents/manifests/v/${APP_IDENTIFIER//.//}" )
if [[ "${VSCODE_QUALITY}" == "insider" ]]; then
RELEASE_VERSION="${RELEASE_VERSION/\-insider/}"
else
VERSIONS=$( curl --silent https://api.github.com/repos/microsoft/winget-pkgs/contents/manifests/v/VSCodium/VSCodium )
fi
WINGET_VERSION=$( echo "${VERSIONS}" | jq -r 'map(.name) | last' )

View File

@ -14,8 +14,8 @@ fi
echo "$( cat "insider.json" | jq --arg 'tag' "${MS_TAG/\-insider/}" --arg 'commit' "${MS_COMMIT}" '. | .tag=$tag | .commit=$commit' )" > "insider.json"
git config --global user.email "vscodium-ci@not-real.com"
git config --global user.name "VSCodium CI"
git config user.email "$( echo "${GITHUB_USERNAME}" | awk '{print tolower($0)}' )-ci@not-real.com"
git config user.name "${GITHUB_USERNAME} CI"
git add .
CHANGES=$( git status --porcelain )

View File

@ -23,7 +23,7 @@ fi
# }
# `url` is URL_BASE + filename of asset e.g.
# darwin: https://github.com/VSCodium/vscodium/releases/download/${RELEASE_VERSION}/VSCodium-darwin-${RELEASE_VERSION}.zip
# darwin: https://github.com/${ASSETS_REPOSITORY}/releases/download/${RELEASE_VERSION}/${APP_NAME}-darwin-${RELEASE_VERSION}.zip
# `name` is $RELEASE_VERSION
# `version` is $BUILD_SOURCEVERSION
# `productVersion` is $RELEASE_VERSION
@ -31,15 +31,7 @@ fi
# `timestamp` is $(node -e 'console.log(Date.now())')
# `sha256hash` in <filename>.sha256
if [[ "${VSCODE_QUALITY}" == "insider" ]]; then
URL_BASE="https://github.com/VSCodium/vscodium-insiders/releases/download/${RELEASE_VERSION}"
else
URL_BASE="https://github.com/VSCodium/vscodium/releases/download/${RELEASE_VERSION}"
fi
# to make testing on forks easier
VERSIONS_REPO="${GITHUB_USERNAME}/versions"
echo "Versions repo: ${VERSIONS_REPO}"
URL_BASE="https://github.com/${ASSETS_REPOSITORY}/releases/download/${RELEASE_VERSION}"
generateJson() {
JSON_DATA="{}"
@ -51,13 +43,13 @@ generateJson() {
local productVersion="${RELEASE_VERSION}"
local timestamp=$(node -e 'console.log(Date.now())')
if [[ ! -f "artifacts/${ASSET_NAME}" ]]; then
echo "Downloading artifact '${ASSET_NAME}'"
gh release download "${RELEASE_VERSION}" --dir "artifacts" --pattern "${ASSET_NAME}*"
if [[ ! -f "assets/${ASSET_NAME}" ]]; then
echo "Downloading asset '${ASSET_NAME}'"
gh release download --repo "${ASSETS_REPOSITORY}" "${RELEASE_VERSION}" --dir "assets" --pattern "${ASSET_NAME}*"
fi
local sha1hash=$(cat "artifacts/${ASSET_NAME}.sha1" | awk '{ print $1 }')
local sha256hash=$(cat "artifacts/${ASSET_NAME}.sha256" | awk '{ print $1 }')
local sha1hash=$(cat "assets/${ASSET_NAME}.sha1" | awk '{ print $1 }')
local sha256hash=$(cat "assets/${ASSET_NAME}.sha256" | awk '{ print $1 }')
# check that nothing is blank (blank indicates something awry with build)
for key in url name version productVersion sha1hash timestamp sha256hash; do
@ -96,42 +88,42 @@ updateLatestVersion() {
# init versions repo for later commiting + pushing the json file to it
# thank you https://www.vinaygopinath.me/blog/tech/commit-to-master-branch-on-github-using-travis-ci/
git clone "https://github.com/${VERSIONS_REPO}.git"
git clone "https://github.com/${VERSIONS_REPOSITORY}.git"
cd versions
git config user.email "vscodium-ci@not-real.com"
git config user.name "VSCodium CI"
git config user.email "$( echo "${GITHUB_USERNAME}" | awk '{print tolower($0)}' )-ci@not-real.com"
git config user.name "${GITHUB_USERNAME} CI"
git remote rm origin
git remote add origin "https://${GITHUB_USERNAME}:${GITHUB_TOKEN}@github.com/${VERSIONS_REPO}.git" > /dev/null 2>&1
git remote add origin "https://${GITHUB_USERNAME}:${GITHUB_TOKEN}@github.com/${VERSIONS_REPOSITORY}.git" > /dev/null 2>&1
cd ..
if [[ "${OS_NAME}" == "osx" ]]; then
ASSET_NAME=VSCodium-darwin-${VSCODE_ARCH}-${RELEASE_VERSION}.zip
ASSET_NAME="${APP_NAME}-darwin-${VSCODE_ARCH}-${RELEASE_VERSION}.zip"
VERSION_PATH="${VSCODE_QUALITY}/darwin/${VSCODE_ARCH}"
updateLatestVersion
elif [[ "${OS_NAME}" == "windows" ]]; then
# system installer
ASSET_NAME=VSCodiumSetup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe
ASSET_NAME="${APP_NAME}Setup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe"
VERSION_PATH="${VSCODE_QUALITY}/win32/${VSCODE_ARCH}/system"
updateLatestVersion
# user installer
ASSET_NAME=VSCodiumUserSetup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe
ASSET_NAME="${APP_NAME}UserSetup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe"
VERSION_PATH="${VSCODE_QUALITY}/win32/${VSCODE_ARCH}/user"
updateLatestVersion
# windows archive
ASSET_NAME=VSCodium-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.zip
ASSET_NAME="${APP_NAME}-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.zip"
VERSION_PATH="${VSCODE_QUALITY}/win32/${VSCODE_ARCH}/archive"
updateLatestVersion
if [[ "${VSCODE_ARCH}" == "ia32" || "${VSCODE_ARCH}" == "x64" ]]; then
# msi
ASSET_NAME=VSCodium-${VSCODE_ARCH}-${RELEASE_VERSION}.msi
ASSET_NAME="${APP_NAME}-${VSCODE_ARCH}-${RELEASE_VERSION}.msi"
VERSION_PATH="${VSCODE_QUALITY}/win32/${VSCODE_ARCH}/msi"
updateLatestVersion
# updates-disabled msi
ASSET_NAME=VSCodium-${VSCODE_ARCH}-updates-disabled-${RELEASE_VERSION}.msi
ASSET_NAME="${APP_NAME}-${VSCODE_ARCH}-updates-disabled-${RELEASE_VERSION}.msi"
VERSION_PATH="${VSCODE_QUALITY}/win32/${VSCODE_ARCH}/msi-updates-disabled"
updateLatestVersion
fi
@ -139,7 +131,7 @@ else # linux
# update service links to tar.gz file
# see https://update.code.visualstudio.com/api/update/linux-x64/stable/VERSION
# as examples
ASSET_NAME=VSCodium-linux-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz
ASSET_NAME="${APP_NAME}-linux-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz"
VERSION_PATH="${VSCODE_QUALITY}/linux/${VSCODE_ARCH}"
updateLatestVersion
fi

View File

@ -2,18 +2,18 @@
if [[ -z "${BUILD_SOURCEVERSION}" ]]; then
vscodium_hash=$( git rev-parse HEAD )
APP_HASH=$( git rev-parse HEAD )
cd vscode
vscode_hash=$( git rev-parse HEAD )
VSCODE_HASH=$( git rev-parse HEAD )
cd ..
if type -t "sha1sum" > /dev/null 2>&1; then
export BUILD_SOURCEVERSION=$( echo "${vscodium_hash}:${vscode_hash}" | sha1sum | cut -d' ' -f1 )
export BUILD_SOURCEVERSION=$( echo "${APP_HASH}:${VSCODE_HASH}" | sha1sum | cut -d' ' -f1 )
else
npm install -g checksum
export BUILD_SOURCEVERSION=$( echo "${vscodium_hash}:${vscode_hash}" | checksum )
export BUILD_SOURCEVERSION=$( echo "${APP_HASH}:${VSCODE_HASH}" | checksum )
fi
echo "BUILD_SOURCEVERSION=\"${BUILD_SOURCEVERSION}\""