diff --git a/.github/workflows/insider-linux.yml b/.github/workflows/insider-linux.yml new file mode 100644 index 0000000..fd39db5 --- /dev/null +++ b/.github/workflows/insider-linux.yml @@ -0,0 +1,155 @@ +name: insider-linux + +on: + workflow_dispatch: + schedule: + - cron: '0 1 * * *' + push: + branches: [ insider ] + paths-ignore: + - '**/*.md' + pull_request: + branches: [ insider ] + paths-ignore: + - '**/*.md' + +jobs: + release: + runs-on: ubuntu-latest + container: + image: ${{ matrix.image }} + env: + OS_NAME: 'linux' + VSCODE_ARCH: ${{ matrix.vscode_arch }} + VSCODE_QUALITY: 'insider' + strategy: + fail-fast: false + matrix: + include: + - vscode_arch: x64 + npm_arch: x64 + image: vscodium/vscodium-linux-build-agent:bionic-x64 + - vscode_arch: arm64 + npm_arch: arm64 + image: vscodium/vscodium-linux-build-agent:stretch-arm64 + - vscode_arch: armhf + npm_arch: armv7l + image: vscodium/vscodium-linux-build-agent:stretch-armhf + + steps: + - uses: actions/checkout@v3 + with: + ref: insider + + - name: Install GH + run: ./install_gh.sh + + - name: Setup Node.js environment + uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Install Yarn + run: npm install -g yarn + + - name: Clone VSCode repo + run: ./get_repo.sh + + - name: Check PR or cron + run: ./check_cron_or_pr.sh + + - name: Check existing VSCodium tags/releases + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: ./check_tags.sh + if: env.SHOULD_DEPLOY == 'yes' + + - name: Compute cache key + id: yarnCacheKey + run: echo "::set-output name=value::$(node build/azure-pipelines/computeYarnCacheKey.js)" + if: env.SHOULD_BUILD == 'yes' + + - name: Get yarn cache directory path + id: yarnCacheDirPath + run: echo "::set-output name=dir::$(yarn cache dir)" + if: env.SHOULD_BUILD == 'yes' + + - name: Cache yarn directory + uses: actions/cache@v3 + with: + path: ${{ steps.yarnCacheDirPath.outputs.dir }} + key: linux-${{ matrix.npm_arch }}-yarnCacheDir-${{ steps.yarnCacheKey.outputs.value }} + restore-keys: linux-${{ matrix.npm_arch }}-yarnCacheDir- + if: env.SHOULD_BUILD == 'yes' + + - name: Build + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + npm_config_arch: ${{ matrix.npm_arch }} + run: ./build.sh + if: env.SHOULD_BUILD == 'yes' + + - name: Prepare artifacts + run: ./prepare_artifacts.sh + if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' + + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: ./release.sh + if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' + + - name: Update versions repo + run: ./update_version.sh + env: + GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }} + GITHUB_USERNAME: ${{ github.repository_owner }} + if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' + + snap: + if: ${{ false }} # more testing need to be done after the first release + needs: release + runs-on: ubuntu-latest + env: + VSCODE_QUALITY: 'insider' + strategy: + fail-fast: false + matrix: + platform: + - amd64 + - arm64 + + steps: + - uses: actions/checkout@v3 + with: + ref: insider + + - name: Check version + run: ./stores/snapcraft/check_version.sh + env: + ARCHITECTURE: ${{ matrix.platform }} + SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }} + + - uses: docker/setup-qemu-action@v1 + if: env.SHOULD_DEPLOY == 'yes' + + - uses: diddlesnaps/snapcraft-multiarch-action@v1 + with: + path: stores/snapcraft/insider + architecture: ${{ matrix.platform }} + id: build + if: env.SHOULD_DEPLOY == 'yes' + + - uses: diddlesnaps/snapcraft-review-action@v1 + with: + snap: ${{ steps.build.outputs.snap }} + isClassic: 'true' + if: env.SHOULD_DEPLOY == 'yes' + + - uses: snapcore/action-publish@master + env: + SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }} + with: + snap: ${{ steps.build.outputs.snap }} + release: stable + if: env.SHOULD_DEPLOY == 'yes' diff --git a/.github/workflows/insider-macos.yml b/.github/workflows/insider-macos.yml new file mode 100644 index 0000000..e8a09e9 --- /dev/null +++ b/.github/workflows/insider-macos.yml @@ -0,0 +1,122 @@ +name: insider-macos + +on: + workflow_dispatch: + schedule: + - cron: '0 1 * * *' + push: + branches: [ insider ] + paths-ignore: + - '**/*.md' + pull_request: + branches: [ insider ] + paths-ignore: + - '**/*.md' + +jobs: + build: + runs-on: ${{ matrix.runner }} + env: + OS_NAME: 'osx' + VSCODE_ARCH: ${{ matrix.vscode_arch }} + VSCODE_QUALITY: 'insider' + strategy: + fail-fast: false + matrix: + include: + - runner: macOS-10.15 + vscode_arch: x64 + - runner: [self-hosted, macOS, ARM64] + vscode_arch: arm64 + + steps: + - uses: actions/checkout@v3 + + - name: Setup Node.js environment + uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Clone VSCode repo + run: . get_repo.sh + + - name: Check PR or cron + run: . check_cron_or_pr.sh + + - name: Check existing VSCodium tags/releases + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NEW_RELEASE: ${{ github.event.inputs.new_release }} + run: . check_tags.sh + if: env.SHOULD_DEPLOY == 'yes' + + - name: Compute cache key + id: yarnCacheKey + run: echo "::set-output name=value::$(node build/azure-pipelines/computeYarnCacheKey.js)" + if: env.SHOULD_BUILD == 'yes' + + - name: Get yarn cache directory path + id: yarnCacheDirPath + run: echo "::set-output name=dir::$(yarn cache dir)" + if: env.SHOULD_BUILD == 'yes' + + - name: Cache yarn directory + uses: actions/cache@v3 + with: + path: ${{ steps.yarnCacheDirPath.outputs.dir }} + key: ${{ env.OS_NAME }}-${{ env.VSCODE_ARCH }}-yarnCacheDir-${{ steps.yarnCacheKey.outputs.value }} + restore-keys: ${{ env.OS_NAME }}-${{ env.VSCODE_ARCH }}-yarnCacheDir- + if: env.SHOULD_BUILD == 'yes' + + - name: Build + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: ./build.sh + if: env.SHOULD_BUILD == 'yes' + + - name: Sign binary + env: + CERTIFICATE_OSX_P12: ${{ secrets.CERTIFICATE_OSX_P12 }} + CERTIFICATE_OSX_PASSWORD: ${{ secrets.CERTIFICATE_OSX_PASSWORD }} + CERTIFICATE_OSX_ID: ${{ secrets.CERTIFICATE_OSX_ID }} + if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' + run: | + if [ -d "VSCode-darwin-${VSCODE_ARCH}" ]; then # just in case the build failed + cd "VSCode-darwin-${VSCODE_ARCH}" + export CERTIFICATE_P12=VSCodium.p12 + echo $CERTIFICATE_OSX_P12 | base64 --decode > $CERTIFICATE_P12 + export KEYCHAIN=$RUNNER_TEMP/build.keychain + security create-keychain -p mysecretpassword $KEYCHAIN + security default-keychain -s $KEYCHAIN + security unlock-keychain -p mysecretpassword $KEYCHAIN + security import $CERTIFICATE_P12 -k $KEYCHAIN -P $CERTIFICATE_OSX_PASSWORD -T /usr/bin/codesign + security set-key-partition-list -S apple-tool:,apple: -s -k mysecretpassword $KEYCHAIN + codesign --deep --force --verbose --sign "$CERTIFICATE_OSX_ID" VSCodium.app + fi + + - name: Prepare artifacts + run: ./prepare_artifacts.sh + if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' + + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: ./release.sh + if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' + + - name: Update versions repo + if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' + run: ./update_version.sh + env: + GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }} + GITHUB_USERNAME: ${{ github.repository_owner }} + + - name: Clean up keychain + if: always() + run: | + KEYCHAIN=$RUNNER_TEMP/build.keychain + + if [ -f "$KEYCHAIN" ]; + then + security delete-keychain $KEYCHAIN + fi diff --git a/.github/workflows/insider-spearhead.yml b/.github/workflows/insider-spearhead.yml new file mode 100644 index 0000000..8fbf398 --- /dev/null +++ b/.github/workflows/insider-spearhead.yml @@ -0,0 +1,75 @@ +name: insider-spearhead + +on: + workflow_dispatch: + schedule: + - cron: '0 0 * * *' + push: + branches: [ insider ] + paths-ignore: + - '**/*.md' + pull_request: + branches: [ insider ] + paths-ignore: + - '**/*.md' + +jobs: + build: + runs-on: [self-hosted, macOS, ARM64] + env: + OS_NAME: 'osx' + VSCODE_ARCH: 'arm64' + VSCODE_QUALITY: 'insider' + + steps: + - uses: actions/checkout@v3 + + - name: Setup Node.js environment + uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Clone VSCode repo + run: . get_repo.sh + + - name: Check PR or cron + run: . check_cron_or_pr.sh + + - name: Check existing VSCodium tags/releases + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NEW_RELEASE: ${{ github.event.inputs.new_release }} + run: . check_tags.sh + if: env.SHOULD_DEPLOY == 'yes' + + - name: Compute cache key + id: yarnCacheKey + run: echo "::set-output name=value::$(node build/azure-pipelines/computeYarnCacheKey.js)" + if: env.SHOULD_BUILD == 'yes' + + - name: Get yarn cache directory path + id: yarnCacheDirPath + run: echo "::set-output name=dir::$(yarn cache dir)" + if: env.SHOULD_BUILD == 'yes' + + - name: Cache yarn directory + uses: actions/cache@v3 + with: + path: ${{ steps.yarnCacheDirPath.outputs.dir }} + key: ${{ env.OS_NAME }}-${{ env.VSCODE_ARCH }}-yarnCacheDir-${{ steps.yarnCacheKey.outputs.value }} + restore-keys: ${{ env.OS_NAME }}-${{ env.VSCODE_ARCH }}-yarnCacheDir- + if: env.SHOULD_BUILD == 'yes' + + - name: Build + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: ./build.sh + if: env.SHOULD_BUILD == 'yes' + + - name: Update insider.json + if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' + run: ./update_insider.sh + env: + GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }} + GITHUB_USERNAME: ${{ github.repository_owner }} + diff --git a/.github/workflows/insider-windows.yml b/.github/workflows/insider-windows.yml new file mode 100644 index 0000000..4b942fa --- /dev/null +++ b/.github/workflows/insider-windows.yml @@ -0,0 +1,104 @@ +name: insider-windows + +on: + workflow_dispatch: + schedule: + - cron: '0 1 * * *' + push: + branches: [ insider ] + paths-ignore: + - '**/*.md' + pull_request: + branches: [ insider ] + paths-ignore: + - '**/*.md' + +jobs: + windows: + runs-on: windows-2019 + defaults: + run: + shell: bash + env: + OS_NAME: 'windows' + VSCODE_ARCH: ${{ matrix.vscode_arch }} + VSCODE_QUALITY: 'insider' + strategy: + fail-fast: false + matrix: + vscode_arch: + - x64 + - ia32 + - arm64 + + steps: + - uses: actions/checkout@v3 + + - name: Setup Node.js environment + uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Install Yarn + run: npm install -g yarn + + - name: Setup Python 3 + uses: actions/setup-python@v3 + with: + python-version: '3.x' + + - name: Clone VSCode repo + run: ./get_repo.sh + + - name: Check PR or cron + run: ./check_cron_or_pr.sh + + - name: Check existing VSCodium tags/releases + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NEW_RELEASE: ${{ github.event.inputs.new_release }} + run: ./check_tags.sh + if: env.SHOULD_DEPLOY == 'yes' + + - name: Compute cache key + id: yarnCacheKey + run: echo "::set-output name=value::$(node build/azure-pipelines/computeYarnCacheKey.js)" + if: env.SHOULD_BUILD == 'yes' + + - name: Get yarn cache directory path + id: yarnCacheDirPath + run: echo "::set-output name=dir::$(yarn cache dir)" + if: env.SHOULD_BUILD == 'yes' + + - name: Cache yarn directory + uses: actions/cache@v3 + with: + path: ${{ steps.yarnCacheDirPath.outputs.dir }} + key: ${{ env.OS_NAME }}-${{ env.VSCODE_ARCH }}-yarnCacheDir-${{ steps.yarnCacheKey.outputs.value }} + restore-keys: ${{ env.OS_NAME }}-${{ env.VSCODE_ARCH }}-yarnCacheDir- + if: env.SHOULD_BUILD == 'yes' + + - name: Build + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + npm_config_arch: ${{ matrix.vscode_arch }} + npm_config_target_arch: ${{ matrix.vscode_arch }} + run: ./build.sh + if: env.SHOULD_BUILD == 'yes' + + - name: Prepare artifacts + run: ./prepare_artifacts.sh + if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' + + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: ./release.sh + if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' + + - name: Update versions repo + if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' + run: ./update_version.sh + env: + GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }} + GITHUB_USERNAME: ${{ github.repository_owner }} diff --git a/.github/workflows/linux.yml b/.github/workflows/stable-linux.yml similarity index 85% rename from .github/workflows/linux.yml rename to .github/workflows/stable-linux.yml index 715454c..908c2f8 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/stable-linux.yml @@ -1,4 +1,4 @@ -name: linux_build +name: stable-linux on: workflow_dispatch: @@ -10,8 +10,12 @@ on: - cron: '0 0 * * *' push: branches: [ master ] + paths-ignore: + - '**/*.md' pull_request: branches: [ master ] + paths-ignore: + - '**/*.md' jobs: release: @@ -113,7 +117,7 @@ jobs: matrix: platform: - amd64 - # - arm64 + - arm64 steps: - uses: actions/checkout@v3 @@ -124,27 +128,21 @@ jobs: ARCHITECTURE: ${{ matrix.platform }} SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }} - # - uses: docker/setup-qemu-action@v1 - # if: env.SHOULD_DEPLOY == 'yes' + - uses: docker/setup-qemu-action@v1 + if: env.SHOULD_DEPLOY == 'yes' - # - uses: diddlesnaps/snapcraft-multiarch-action@v1 - # with: - # path: stores/snapcraft - # architecture: ${{ matrix.platform }} - # id: build - # if: env.SHOULD_DEPLOY == 'yes' - - # - uses: diddlesnaps/snapcraft-review-action@v1 - # with: - # snap: ${{ steps.build.outputs.snap }} - # isClassic: 'true' - # if: env.SHOULD_DEPLOY == 'yes' - - uses: snapcore/action-build@v1 + - uses: diddlesnaps/snapcraft-multiarch-action@v1 with: - path: stores/snapcraft + path: stores/snapcraft/stable + architecture: ${{ matrix.platform }} id: build if: env.SHOULD_DEPLOY == 'yes' + - uses: diddlesnaps/snapcraft-review-action@v1 + with: + snap: ${{ steps.build.outputs.snap }} + isClassic: 'true' + if: env.SHOULD_DEPLOY == 'yes' - uses: snapcore/action-publish@master env: diff --git a/.github/workflows/macos.yml b/.github/workflows/stable-macos.yml similarity index 97% rename from .github/workflows/macos.yml rename to .github/workflows/stable-macos.yml index 5373e3c..f1954f7 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/stable-macos.yml @@ -1,4 +1,4 @@ -name: macos_build +name: stable-macos on: workflow_dispatch: @@ -10,13 +10,19 @@ on: - cron: '0 0 * * *' push: branches: [ master ] + paths-ignore: + - '**/*.md' pull_request: branches: [ master ] + paths-ignore: + - '**/*.md' jobs: build: runs-on: ${{ matrix.runner }} - + env: + OS_NAME: 'osx' + VSCODE_ARCH: ${{ matrix.vscode_arch }} strategy: fail-fast: false matrix: @@ -26,10 +32,6 @@ jobs: - runner: [self-hosted, macOS, ARM64] vscode_arch: arm64 - env: - OS_NAME: "osx" - VSCODE_ARCH: ${{ matrix.vscode_arch }} - steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/windows.yml b/.github/workflows/stable-windows.yml similarity index 97% rename from .github/workflows/windows.yml rename to .github/workflows/stable-windows.yml index 9bd78bf..8a3f990 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/stable-windows.yml @@ -1,4 +1,4 @@ -name: windows_build +name: stable-windows on: workflow_dispatch: @@ -10,8 +10,12 @@ on: - cron: '0 0 * * *' push: branches: [ master ] + paths-ignore: + - '**/*.md' pull_request: branches: [ master ] + paths-ignore: + - '**/*.md' jobs: windows: diff --git a/build/build.sh b/build/build.sh index 5ed9ad8..98485ca 100755 --- a/build/build.sh +++ b/build/build.sh @@ -4,13 +4,13 @@ # to run with Bash: "C:\Program Files\Git\bin\bash.exe" ./build/build.sh ### -export INSIDER="no" export VSCODE_LATEST="no" +export VSCODE_QUALITY="stable" while getopts ":il" opt; do case "$opt" in i) - export INSIDER="yes" + export VSCODE_QUALITY="insider" ;; l) export VSCODE_LATEST="yes" @@ -41,7 +41,7 @@ fi echo "OS_NAME: ${OS_NAME}" echo "VSCODE_ARCH: ${VSCODE_ARCH}" echo "VSCODE_LATEST: ${VSCODE_LATEST}" -echo "INSIDER: ${INSIDER}" +echo "VSCODE_QUALITY: ${VSCODE_QUALITY}" rm -rf vscode* VSCode* diff --git a/build/linux/appimage/build.sh b/build/linux/appimage/build.sh index cad8b9f..365c09b 100755 --- a/build/linux/appimage/build.sh +++ b/build/linux/appimage/build.sh @@ -18,6 +18,16 @@ if [[ "${VSCODE_ARCH}" == "x64" ]]; then # remove check so build in docker can succeed sed -i 's/grep docker/# grep docker/' pkg2appimage.AppDir/usr/share/pkg2appimage/functions.sh + if [[ "${VSCODE_QUALITY}" == "insider" ]]; then + sed -i 's|@@NAME@@|VSCodium - Insiders|g' recipe.yml + sed -i 's|@@APPNAME@@|codium-insiders|g' recipe.yml + sed -i 's|@@ICON@@|vscodium-insiders|g' recipe.yml + else + sed -i 's|@@NAME@@|VSCodium|g' recipe.yml + sed -i 's|@@APPNAME@@|codium|g' recipe.yml + sed -i 's|@@ICON@@|vscodium|g' recipe.yml + fi + bash -ex pkg2appimage.AppDir/AppRun recipe.yml rm -f pkg2appimage-*.AppImage diff --git a/build/linux/appimage/recipe.yml b/build/linux/appimage/recipe.yml index ff74d47..59c2737 100644 --- a/build/linux/appimage/recipe.yml +++ b/build/linux/appimage/recipe.yml @@ -5,7 +5,7 @@ # wget -c "https://github.com/AppImage/pkg2appimage/raw/master/pkg2appimage" # bash -ex pkg2appimage VSCodium -app: VSCodium +app: @@NAME@@ ingredients: packages: @@ -17,19 +17,19 @@ ingredients: script: - pwd - cp ../../../../vscode/.build/linux/deb/amd64/deb/*.deb . - - ls codium_*.deb | cut -d _ -f 2 > VERSION + - ls @@APPNAME@@_*.deb | cut -d _ -f 2 > VERSION script: - - sed -i -e 's|/usr/share/pixmaps/||g' usr/share/applications/codium.desktop - - cp usr/share/applications/codium.desktop . - - cp usr/share/pixmaps/vscodium.png . - - /usr/bin/convert vscodium.png -resize 512x512 usr/share/icons/hicolor/512x512/apps/vscodium.png - - /usr/bin/convert vscodium.png -resize 256x256 usr/share/icons/hicolor/256x256/apps/vscodium.png - - /usr/bin/convert vscodium.png -resize 128x128 usr/share/icons/hicolor/128x128/apps/vscodium.png - - /usr/bin/convert vscodium.png -resize 64x64 usr/share/icons/hicolor/64x64/apps/vscodium.png - - /usr/bin/convert vscodium.png -resize 48x48 usr/share/icons/hicolor/48x48/apps/vscodium.png - - /usr/bin/convert vscodium.png -resize 32x32 usr/share/icons/hicolor/32x32/apps/vscodium.png - - ( cd usr/bin/ ; ln -s ../share/codium/codium . ) + - sed -i -e 's|/usr/share/pixmaps/||g' usr/share/applications/@@APPNAME@@.desktop + - cp usr/share/applications/@@APPNAME@@.desktop . + - cp usr/share/pixmaps/@@ICON@@.png . + - /usr/bin/convert @@ICON@@.png -resize 512x512 usr/share/icons/hicolor/512x512/apps/@@ICON@@.png + - /usr/bin/convert @@ICON@@.png -resize 256x256 usr/share/icons/hicolor/256x256/apps/@@ICON@@.png + - /usr/bin/convert @@ICON@@.png -resize 128x128 usr/share/icons/hicolor/128x128/apps/@@ICON@@.png + - /usr/bin/convert @@ICON@@.png -resize 64x64 usr/share/icons/hicolor/64x64/apps/@@ICON@@.png + - /usr/bin/convert @@ICON@@.png -resize 48x48 usr/share/icons/hicolor/48x48/apps/@@ICON@@.png + - /usr/bin/convert @@ICON@@.png -resize 32x32 usr/share/icons/hicolor/32x32/apps/@@ICON@@.png + - ( cd usr/bin/ ; ln -s ../share/@@APPNAME@@/@@APPNAME@@ . ) - rm -rf usr/lib/x86_64-linux-gnu - rm -f lib/x86_64-linux-gnu/libglib* - cat > AppRun <<\EOF diff --git a/build/windows/msi/build.sh b/build/windows/msi/build.sh index 027d315..c79abf4 100644 --- a/build/windows/msi/build.sh +++ b/build/windows/msi/build.sh @@ -9,12 +9,14 @@ cd "$( dirname "${BASH_SOURCE[0]}" )" WIN_SDK_MAJOR_VERSION="10" WIN_SDK_FULL_VERSION="10.0.17763.0" -if [[ "${INSIDER}" == "yes" ]]; then +if [[ "${VSCODE_QUALITY}" == "insider" ]]; then PRODUCT_NAME="VSCodium - Insiders" PRODUCT_SKU="vscodium-insiders" + ICON_DIR="..\\..\\..\\src\\insider\\resources\\win32" else PRODUCT_NAME="VSCodium" PRODUCT_SKU="vscodium" + ICON_DIR="..\\..\\..\\src\\stable\\resources\\win32" fi PRODUCT_ID=$( powershell.exe -command "[guid]::NewGuid().ToString().ToUpper()" ) @@ -26,7 +28,6 @@ LANGIDS="1033" SETUP_RELEASE_DIR=".\\releasedir" SETUP_RESOURCES_DIR=".\\resources" BINARY_DIR="..\\..\\..\\VSCode-win32-${VSCODE_ARCH}" -ICON_DIR="..\\..\\..\\src\\resources\\win32" LICENSE_DIR="..\\..\\..\\vscode" PROGRAM_FILES_86=$( env | sed -n 's/^ProgramFiles(x86)=//p' ) diff --git a/check_tags.sh b/check_tags.sh index fbddf1d..5910672 100755 --- a/check_tags.sh +++ b/check_tags.sh @@ -7,9 +7,12 @@ if [[ -z "${GITHUB_TOKEN}" ]]; then exit fi -VERSIONS_REPO="${GITHUB_USERNAME:-"VSCodium"}/versions" +if [[ "${VSCODE_QUALITY}" == "insider" ]]; then + REPOSITORY="${GITHUB_REPOSITORY:-"VSCodium/vscodium"}-insiders" +else + REPOSITORY="${GITHUB_REPOSITORY:-"VSCodium/vscodium"}" +fi -REPOSITORY="${GITHUB_REPOSITORY:-"VSCodium/vscodium"}" GITHUB_RESPONSE=$( curl -s -H "Authorization: token ${GITHUB_TOKEN}" "https://api.github.com/repos/${REPOSITORY}/releases/latest" ) LATEST_VERSION=$( echo "${GITHUB_RESPONSE}" | jq -c -r '.tag_name' ) diff --git a/docs/build.md b/docs/build.md index 6c5ccbd..e3425fd 100644 --- a/docs/build.md +++ b/docs/build.md @@ -49,11 +49,17 @@ ## Build Scripts -Each platform has its build helper script in the directory `build`. +A build helper script can be found at `build/build.sh`. -- Linux: `./build/build_linux.sh` -- MacOS: `./build/build_macos.sh` -- Windows: `powershell -ExecutionPolicy ByPass -File .\build\build_windows.ps1` +- Linux: `./build/build.sh` +- MacOS: `./build/build.sh` +- Windows: `powershell -ExecutionPolicy ByPass -File .\build\build.ps1` or `"C:\Program Files\Git\bin\bash.exe" ./build/build.sh` + +### Insider + +The `insider` version can be built with `./build/build.sh -i` on the `insider` branch. + +You can try the lastest version with the command `./build/build.sh -il` but the patches might not be up to date. ## Build in Docker diff --git a/get_repo.sh b/get_repo.sh index 2790c79..ee4b605 100755 --- a/get_repo.sh +++ b/get_repo.sh @@ -8,7 +8,7 @@ if [[ "${CI_BUILD}" != "no" ]]; then fi if [[ -z "${RELEASE_VERSION}" ]]; then - if [[ "${INSIDER}" == "yes" ]]; then + if [[ "${VSCODE_QUALITY}" == "insider" ]]; then if [[ "${VSCODE_LATEST}" == "yes" ]] || [[ ! -f "insider.json" ]]; then UPDATE_INFO=$( curl https://update.code.visualstudio.com/api/update/darwin/insider/lol ) else @@ -26,7 +26,7 @@ if [[ -z "${RELEASE_VERSION}" ]]; then date=$( date +%Y%j ) - if [[ "${INSIDER}" == "yes" ]]; then + if [[ "${VSCODE_QUALITY}" == "insider" ]]; then export RELEASE_VERSION="${MS_TAG/\-insider/}.${date: -5}-insider" else export RELEASE_VERSION="${MS_TAG}.${date: -5}" @@ -51,7 +51,7 @@ git remote add origin https://github.com/Microsoft/vscode.git # figure out latest tag by calling MS update API if [[ -z "${MS_TAG}" ]]; then - if [[ "${INSIDER}" == "yes" ]]; then + if [[ "${VSCODE_QUALITY}" == "insider" ]]; then UPDATE_INFO=$( curl https://update.code.visualstudio.com/api/update/darwin/insider/lol ) else UPDATE_INFO=$( curl https://update.code.visualstudio.com/api/update/darwin/stable/lol ) diff --git a/prepare_vscode.sh b/prepare_vscode.sh index 1d212e6..6d14825 100755 --- a/prepare_vscode.sh +++ b/prepare_vscode.sh @@ -5,7 +5,7 @@ set -e # include common functions . ./utils.sh -if [[ "${INSIDER}" == "yes" ]]; then +if [[ "${VSCODE_QUALITY}" == "insider" ]]; then cp -rp src/insider/* vscode/ else cp -rp src/stable/* vscode/ @@ -30,7 +30,7 @@ for file in ../patches/*.patch; do fi done -if [[ "${INSIDER}" == "yes" ]]; then +if [[ "${VSCODE_QUALITY}" == "insider" ]]; then for file in ../patches/insider/*.patch; do if [ -f "${file}" ]; then echo applying patch: "${file}"; @@ -91,7 +91,6 @@ setpath "product" "keyboardShortcutsUrlMac" "https://go.microsoft.com/fwlink/?li setpath "product" "keyboardShortcutsUrlWin" "https://go.microsoft.com/fwlink/?linkid=832145" setpath "product" "licenseUrl" "https://github.com/VSCodium/vscodium/blob/master/LICENSE" setpath "product" "linkProtectionTrustedDomains" '["https://open-vsx.org"]' -setpath "product" "linuxIconName" "vscodium" setpath "product" "releaseNotesUrl" "https://go.microsoft.com/fwlink/?LinkID=533483#vscode" setpath "product" "reportIssueUrl" "https://github.com/VSCodium/vscodium/issues/new" setpath "product" "requestFeatureUrl" "https://go.microsoft.com/fwlink/?LinkID=533482" @@ -99,11 +98,12 @@ setpath "product" "tipsAndTricksUrl" "https://go.microsoft.com/fwlink/?linkid=85 setpath "product" "twitterUrl" "https://go.microsoft.com/fwlink/?LinkID=533687" setpath "product" "updateUrl" "https://vscodium.now.sh" -if [[ "${INSIDER}" == "yes" ]]; then +if [[ "${VSCODE_QUALITY}" == "insider" ]]; then setpath "product" "nameShort" "VSCodium - Insiders" setpath "product" "nameLong" "VSCodium - Insiders" setpath "product" "applicationName" "codium-insiders" setpath "product" "dataFolderName" ".vscodium-insiders" + setpath "product" "linuxIconName" "vscodium-insiders" setpath "product" "quality" "insider" setpath "product" "urlProtocol" "vscodium-insiders" setpath "product" "serverApplicationName" "codium-server-insiders" @@ -125,6 +125,7 @@ else setpath "product" "nameShort" "VSCodium" setpath "product" "nameLong" "VSCodium" setpath "product" "applicationName" "codium" + setpath "product" "linuxIconName" "vscodium" setpath "product" "quality" "stable" setpath "product" "urlProtocol" "vscodium" setpath "product" "serverApplicationName" "codium-server" @@ -159,7 +160,7 @@ if [[ "${OS_NAME}" == "linux" ]]; then # unless the app name is code-oss # as we are renaming the application to vscodium # we need to edit a line in the post install template - if [[ "${INSIDER}" == "yes" ]]; then + if [[ "${VSCODE_QUALITY}" == "insider" ]]; then sed -i "s/code-oss/codium-insiders/" resources/linux/debian/postinst.template else sed -i "s/code-oss/codium/" resources/linux/debian/postinst.template diff --git a/release.sh b/release.sh index 2c564cc..c75c05d 100755 --- a/release.sh +++ b/release.sh @@ -7,26 +7,31 @@ 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" +else + REPOSITORY="${REPO_NAME:-"vscodium"}" +fi + npm install -g github-release-cli if [[ $( gh release view "${RELEASE_VERSION}" 2>&1 ) =~ "release not found" ]]; then echo "Creating release '${RELEASE_VERSION}'" - gh release create "${RELEASE_VERSION}" + gh release create --repo "${REPOSITORY}" "${RELEASE_VERSION}" fi cd artifacts set +e -OWNER="${GITHUB_REPOSITORY_OWNER:-"VSCodium"}" -REPO_NAME="${GITHUB_REPOSITORY:(${#OWNER}+1)}" -REPOSITORY="${REPO_NAME:-"vscodium"}" - for FILE in * do if [[ -f "${FILE}" ]] && [[ "${FILE}" != *.sha1 ]] && [[ "${FILE}" != *.sha256 ]]; then echo "::group::Uploading '${FILE}' at $( date "+%T" )" - gh release upload "${RELEASE_VERSION}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256" + gh release upload --repo "${REPOSITORY}" "${RELEASE_VERSION}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256" EXIT_STATUS=$? echo "exit: ${EXIT_STATUS}" @@ -39,7 +44,7 @@ do sleep $(( 15 * (i + 1))) echo "RE-Uploading '${FILE}' at $( date "+%T" )" - gh release upload "${RELEASE_VERSION}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256" + gh release upload --repo "${REPOSITORY}" "${RELEASE_VERSION}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256" EXIT_STATUS=$? echo "exit: ${EXIT_STATUS}" diff --git a/stores/snapcraft/check_version.sh b/stores/snapcraft/check_version.sh index 7e8326c..55dd06a 100755 --- a/stores/snapcraft/check_version.sh +++ b/stores/snapcraft/check_version.sh @@ -13,14 +13,22 @@ elif [[ "${GITHUB_EVENT_NAME}" == "push" ]]; then else echo "It's a cron" + if [[ "${VSCODE_QUALITY}" == "insider" ]]; then + REPOSITORY="${GITHUB_REPOSITORY:-"VSCodium/vscodium"}-insiders" + SNAP_NAME="codium-insiders" + else + REPOSITORY="${GITHUB_REPOSITORY:-"VSCodium/vscodium"}" + SNAP_NAME="codium" + fi + sudo snap install --channel stable --classic snapcraft echo "Architecture: ${ARCHITECTURE}" - SNAP_VERSION=$(snapcraft list-revisions codium | grep -F "stable*" | grep "${ARCHITECTURE}" | tr -s ' ' | cut -d ' ' -f 4) + 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/VSCodium/vscodium/releases -O gh_latest.json + wget --quiet "https://api.github.com/repos/${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}" @@ -32,7 +40,7 @@ else export SHOULD_DEPLOY="yes" snap version - snap info codium + snap info "${SNAP_NAME}" fi fi diff --git a/stores/snapcraft/snap/local/bin/electron-launch b/stores/snapcraft/insider/snap/local/bin/electron-launch similarity index 100% rename from stores/snapcraft/snap/local/bin/electron-launch rename to stores/snapcraft/insider/snap/local/bin/electron-launch diff --git a/stores/snapcraft/insider/snap/snapcraft.yaml b/stores/snapcraft/insider/snap/snapcraft.yaml new file mode 100644 index 0000000..f2e1e42 --- /dev/null +++ b/stores/snapcraft/insider/snap/snapcraft.yaml @@ -0,0 +1,88 @@ +name: codium-insiders +adopt-info: codium-insiders +summary: Code editing. Redefined. +description: | + Binary releases of Code without branding/telemetry/licensing + +base: core18 +grade: stable +confinement: classic +compression: lzo + +parts: + codium: + plugin: nil + override-build: | + set -eu + ARCHITECTURE=$(dpkg --print-architecture) + # Get GitHub releases + wget --quiet https://api.github.com/repos/VSCodium/vscodium-insiders/releases -O latest.json + VERSION=$(jq -r 'sort_by(.tag_name)|last.tag_name' latest.json) + DEB_URL=$(jq -r 'map(select(.tag_name == "'"$VERSION"'"))|first.assets[].browser_download_url|select(endswith("'"_$ARCHITECTURE.deb"'"))' latest.json) + DEB=$(basename "${DEB_URL}") + # Downloading .deb" + wget "${DEB_URL}" -O "${SNAPCRAFT_PART_INSTALL}/${DEB}" + # Unpacking .deb" + dpkg -x "${SNAPCRAFT_PART_INSTALL}/${DEB}" ${SNAPCRAFT_PART_INSTALL} + rm -f latest.json + rm -f "${SNAPCRAFT_PART_INSTALL}/${DEB}" + # Set version + snapcraftctl set-version "$VERSION" + # Correct path to icon. + sed -i 's|Icon=vscodium|Icon=${SNAP}/usr/share/pixmaps/vscodium.png|g' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/codium.desktop + sed -i 's|Exec=/usr/share/codium/codium|Exec=codium|g' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/codium.desktop + sed -i 's|Icon=vscodium|Icon=/usr/share/pixmaps/vscodium.png|g' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/codium-url-handler.desktop + build-packages: + - wget + - jq + stage-packages: + - fcitx-frontend-gtk3 + - gvfs-libs + - libasound2 + - libgconf-2-4 + - libglib2.0-bin + - libgnome-keyring0 + - libgtk-3-0 + - libnotify4 + - libnspr4 + - libnss3 + - libpcre3 + - libpulse0 + - libsecret-1-0 + - libxshmfence1 + - libxss1 + - libxtst6 + - zlib1g + - libx11-xcb1 + - libxkbfile1 + - libdrm2 + - libgbm1 + - libxcb-dri3-0 + prime: + - -usr/share/doc + - -usr/share/fonts + - -usr/share/icons + - -usr/share/lintian + - -usr/share/man + - -usr/share/codium/chrome-sandbox + + electron-launch: + after: + - codium + plugin: dump + source: snap/local + +apps: + codium: + command: electron-launch $SNAP/usr/share/codium/bin/codium --no-sandbox + desktop: usr/share/applications/codium.desktop + environment: + DISABLE_WAYLAND: 1 + GSETTINGS_SCHEMA_DIR: $SNAP/usr/share/glib-2.0/schemas + + url-handler: + command: electron-launch $SNAP/usr/share/codium/bin/codium --open-url --no-sandbox + desktop: usr/share/applications/codium-url-handler.desktop + environment: + DISABLE_WAYLAND: 1 + GSETTINGS_SCHEMA_DIR: $SNAP/usr/share/glib-2.0/schemas diff --git a/stores/snapcraft/stable/snap/local/bin/electron-launch b/stores/snapcraft/stable/snap/local/bin/electron-launch new file mode 100755 index 0000000..9f4eb6a --- /dev/null +++ b/stores/snapcraft/stable/snap/local/bin/electron-launch @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +# On Fedora $SNAP is under /var and there is some magic to map it to /snap. +# We need to handle that case and reset $SNAP +SNAP=$(echo "$SNAP" | sed -e "s|/var/lib/snapd||g") + +if [ "$SNAP_ARCH" == "amd64" ]; then + ARCH="x86_64-linux-gnu" +elif [ "$SNAP_ARCH" == "armhf" ]; then + ARCH="arm-linux-gnueabihf" +elif [ "$SNAP_ARCH" == "arm64" ]; then + ARCH="aarch64-linux-gnu" +else + ARCH="$SNAP_ARCH-linux-gnu" +fi + +GDK_CACHE_DIR="$SNAP_USER_COMMON/.cache" +if [[ -d "$SNAP_USER_DATA/.cache" && ! -e "$GDK_CACHE_DIR" ]]; then + # the .cache directory used to be stored under $SNAP_USER_DATA, migrate it + mv "$SNAP_USER_DATA/.cache" "$SNAP_USER_COMMON/" +fi +[ ! -d "$GDK_CACHE_DIR" ] && mkdir -p "$GDK_CACHE_DIR" + +# Gdk-pixbuf loaders +export GDK_PIXBUF_MODULE_FILE="$GDK_CACHE_DIR/gdk-pixbuf-loaders.cache" +export GDK_PIXBUF_MODULEDIR="$SNAP/usr/lib/$ARCH/gdk-pixbuf-2.0/2.10.0/loaders" +if [ -f "$SNAP/usr/lib/$ARCH/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders" ]; then + "$SNAP/usr/lib/$ARCH/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders" > "$GDK_PIXBUF_MODULE_FILE" +fi + +# Create $XDG_RUNTIME_DIR if not exists (to be removed when https://pad.lv/1656340 is fixed) +[ -n "$XDG_RUNTIME_DIR" ] && mkdir -p "$XDG_RUNTIME_DIR" -m 700 + +exec "$@" diff --git a/stores/snapcraft/snap/snapcraft.yaml b/stores/snapcraft/stable/snap/snapcraft.yaml similarity index 97% rename from stores/snapcraft/snap/snapcraft.yaml rename to stores/snapcraft/stable/snap/snapcraft.yaml index 68e0c06..b2b89f9 100644 --- a/stores/snapcraft/snap/snapcraft.yaml +++ b/stores/snapcraft/stable/snap/snapcraft.yaml @@ -8,9 +8,6 @@ base: core18 grade: stable confinement: classic compression: lzo -# architectures: -# - build-on: amd64 -# - build-on: arm64 parts: codium: diff --git a/update_insider.sh b/update_insider.sh new file mode 100755 index 0000000..75e8d38 --- /dev/null +++ b/update_insider.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +set -e + +if [[ "${SHOULD_BUILD}" != "yes" ]]; then + echo "Will not update version JSON because we did not build" + exit +fi + +if [[ -z "${GITHUB_TOKEN}" ]]; then + echo "Will not update insider.json because no GITHUB_TOKEN defined" + exit +fi + +echo "$( cat "insider.json" | jq --arg 'tag' "${MS_TAG}" --arg 'commit' "${MS_COMMIT}" '. | .tag=$tag | .commit=$commit' )" > "insider.json" + +git config user.name "VSCodium CI" +git add . + +CHANGES=$( git status --porcelain ) + +if [[ ! -z "${CHANGES}" ]]; then + git commit -m "build(insider): update to commit ${MS_COMMIT:0:7}" + if ! git push origin master --quiet; then + git pull origin master + git push origin master --quiet + fi +fi diff --git a/update_version.sh b/update_version.sh index 0d5d59c..3ddf548 100755 --- a/update_version.sh +++ b/update_version.sh @@ -31,7 +31,11 @@ fi # `timestamp` is $(node -e 'console.log(Date.now())') # `sha256hash` in .sha256 -URL_BASE="https://github.com/VSCodium/vscodium/releases/download/${RELEASE_VERSION}" +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" @@ -102,33 +106,33 @@ cd .. if [[ "${OS_NAME}" == "osx" ]]; then ASSET_NAME=VSCodium-darwin-${VSCODE_ARCH}-${RELEASE_VERSION}.zip - VERSION_PATH="darwin/${VSCODE_ARCH}" + VERSION_PATH="${VSCODE_QUALITY}/darwin/${VSCODE_ARCH}" updateLatestVersion elif [[ "${OS_NAME}" == "windows" ]]; then # system installer ASSET_NAME=VSCodiumSetup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe - VERSION_PATH="win32/${VSCODE_ARCH}/system" + VERSION_PATH="${VSCODE_QUALITY}/win32/${VSCODE_ARCH}/system" updateLatestVersion # user installer ASSET_NAME=VSCodiumUserSetup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe - VERSION_PATH="win32/${VSCODE_ARCH}/user" + VERSION_PATH="${VSCODE_QUALITY}/win32/${VSCODE_ARCH}/user" updateLatestVersion # windows archive ASSET_NAME=VSCodium-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.zip - VERSION_PATH="win32/${VSCODE_ARCH}/archive" + 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 - VERSION_PATH="win32/${VSCODE_ARCH}/msi" + VERSION_PATH="${VSCODE_QUALITY}/win32/${VSCODE_ARCH}/msi" updateLatestVersion # updates-disabled msi ASSET_NAME=VSCodium-${VSCODE_ARCH}-updates-disabled-${RELEASE_VERSION}.msi - VERSION_PATH="win32/${VSCODE_ARCH}/msi-updates-disabled" + VERSION_PATH="${VSCODE_QUALITY}/win32/${VSCODE_ARCH}/msi-updates-disabled" updateLatestVersion fi else # linux @@ -136,7 +140,7 @@ else # linux # see https://update.code.visualstudio.com/api/update/linux-x64/stable/VERSION # as examples ASSET_NAME=VSCodium-linux-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz - VERSION_PATH="linux/${VSCODE_ARCH}" + VERSION_PATH="${VSCODE_QUALITY}/linux/${VSCODE_ARCH}" updateLatestVersion fi