name: CI - Build - Linux on: workflow_dispatch: inputs: generate_assets: type: boolean description: Generate assets checkout_pr: type: string description: Checkout PR push: branches: - master - insider paths-ignore: - "**/*.md" pull_request: branches: - "**" paths-ignore: - "**/*.md" env: ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true APP_NAME: VSCodium BINARY_NAME: ${{ (github.ref == 'refs/heads/insider' || (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'insider')) && 'codium-insiders' || 'codium' }} DISABLE_UPDATE: yes GH_REPO_PATH: ${{ github.repository }} GITHUB_BRANCH: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.event.head }} ORG_NAME: ${{ github.repository_owner }} OS_NAME: linux VSCODE_QUALITY: ${{ (github.ref == 'refs/heads/insider' || (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'insider')) && 'insider' || 'stable' }} permissions: {} jobs: compile: runs-on: ubuntu-22.04 env: VSCODE_ARCH: x64 outputs: BUILD_SOURCEVERSION: ${{ env.BUILD_SOURCEVERSION }} MS_COMMIT: ${{ env.MS_COMMIT }} MS_TAG: ${{ env.MS_TAG }} RELEASE_VERSION: ${{ env.RELEASE_VERSION }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: ref: ${{ env.GITHUB_BRANCH }} persist-credentials: false - name: Switch to relevant branch env: PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }} run: ./get_pr.sh - name: Setup GCC uses: egor-tensin/setup-gcc@a2861a8b8538f49cf2850980acccf6b05a1b2ae4 # v2.0 with: version: 10 platform: x64 - name: Setup Node.js environment uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 with: node-version-file: .nvmrc - name: Setup Python 3 uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: "3.11" - name: Install libkrb5-dev run: sudo apt-get update -y && sudo apt-get install -y libkrb5-dev - name: Clone VSCode repo run: ./get_repo.sh - name: Build env: SHOULD_BUILD_REH: no SHOULD_BUILD_REH_WEB: no run: ./build.sh - name: Compress vscode artifact run: | find vscode -type f -not -path "*/node_modules/*" -not -path "vscode/.build/node/*" -not -path "vscode/.git/*" > vscode.txt echo "vscode/.build/extensions/node_modules" >> vscode.txt echo "vscode/.git" >> vscode.txt tar -czf vscode.tar.gz -T vscode.txt - name: Upload vscode artifact uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: vscode path: ./vscode.tar.gz retention-days: 1 build: needs: - compile runs-on: ubuntu-latest strategy: fail-fast: false matrix: include: - slug: X64 vscode_arch: x64 npm_arch: x64 image: vscodium/vscodium-linux-build-agent:focal-x64 - slug: ARM64 vscode_arch: arm64 npm_arch: arm64 image: vscodium/vscodium-linux-build-agent:focal-arm64 - slug: ARM32 vscode_arch: armhf npm_arch: arm image: vscodium/vscodium-linux-build-agent:focal-armhf - slug: RISCV64 vscode_arch: riscv64 npm_arch: riscv64 image: vscodium/vscodium-linux-build-agent:focal-riscv64 - slug: LOONG64 vscode_arch: loong64 npm_arch: loong64 image: vscodium/vscodium-linux-build-agent:crimson-loong64 - slug: PPC64 vscode_arch: ppc64le npm_arch: ppc64 image: vscodium/vscodium-linux-build-agent:focal-ppc64le container: image: ${{ matrix.image }} env: BUILD_SOURCEVERSION: ${{ needs.compile.outputs.BUILD_SOURCEVERSION }} DISABLED: ${{ vars[format('DISABLE_{0}_LINUX_APP_{1}', ((github.ref == 'refs/heads/insider' || (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'insider')) && 'INSIDER' || 'STABLE'), matrix.slug)] }} MS_COMMIT: ${{ needs.compile.outputs.MS_COMMIT }} MS_TAG: ${{ needs.compile.outputs.MS_TAG }} RELEASE_VERSION: ${{ needs.compile.outputs.RELEASE_VERSION }} VSCODE_ARCH: ${{ matrix.vscode_arch }} outputs: RELEASE_VERSION: ${{ env.RELEASE_VERSION }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: ref: ${{ env.GITHUB_BRANCH }} persist-credentials: false if: env.DISABLED != 'yes' - name: Switch to relevant branch env: PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }} run: ./get_pr.sh if: env.DISABLED != 'yes' - name: Install GH run: ./build/linux/install_gh.sh if: env.DISABLED != 'yes' - name: Install dependencies run: ./build/linux/deps.sh if: env.DISABLED != 'yes' - uses: actions-rust-lang/setup-rust-toolchain@2b1f5e9b395427c92ee4e3331786ca3c37afe2d7 # v1.16.0 if: env.DISABLED != 'yes' - name: Download vscode artifact uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: vscode if: env.DISABLED != 'yes' - name: Build id: build env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} npm_config_arch: ${{ matrix.npm_arch }} run: ./build/linux/package_bin.sh if: env.DISABLED != 'yes' - name: Prepare assets env: SHOULD_BUILD_APPIMAGE: ${{ (vars[format('DISABLE_{0}_APPIMAGE', ((github.ref == 'refs/heads/insider' || (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'insider')) && 'INSIDER' || 'STABLE'))] == 'yes' && 'no' || 'yes' }} SHOULD_BUILD_REH: 'no' SHOULD_BUILD_REH_WEB: 'no' VSCODE_SYSROOT_REPOSITORY: ${{ steps.build.outputs.VSCODE_SYSROOT_REPOSITORY }} VSCODE_SYSROOT_VERSION: ${{ steps.build.outputs.VSCODE_SYSROOT_VERSION }} VSCODE_SYSROOT_PREFIX: ${{ steps.build.outputs.VSCODE_SYSROOT_PREFIX }} run: ./prepare_assets.sh if: env.DISABLED != 'yes' && github.event.inputs.generate_assets == 'true' - name: Upload assets uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: bin-${{ matrix.vscode_arch }} path: assets/ retention-days: 3 if: env.DISABLED != 'yes' && github.event.inputs.generate_assets == 'true' reh_linux: needs: - compile runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: include: - slug: X64 vscode_arch: x64 npm_arch: x64 - slug: ARM64 vscode_arch: arm64 npm_arch: arm64 - slug: ARM32 vscode_arch: armhf npm_arch: arm - slug: PPC64 vscode_arch: ppc64le npm_arch: ppc64 - slug: RISCV64 vscode_arch: riscv64 npm_arch: riscv64 - slug: LOONG64 vscode_arch: loong64 npm_arch: loong64 - slug: S390X vscode_arch: s390x npm_arch: s390x env: BUILD_SOURCEVERSION: ${{ needs.compile.outputs.BUILD_SOURCEVERSION }} DISABLED: ${{ vars[format('DISABLE_{0}_LINUX_REH_{1}', ((github.ref == 'refs/heads/insider' || (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'insider')) && 'INSIDER' || 'STABLE'), matrix.slug)] }} MS_COMMIT: ${{ needs.compile.outputs.MS_COMMIT }} MS_TAG: ${{ needs.compile.outputs.MS_TAG }} RELEASE_VERSION: ${{ needs.compile.outputs.RELEASE_VERSION }} VSCODE_ARCH: ${{ matrix.vscode_arch }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: ref: ${{ env.GITHUB_BRANCH }} persist-credentials: false if: env.DISABLED != 'yes' - name: Switch to relevant branch env: PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }} run: ./get_pr.sh if: env.DISABLED != 'yes' - name: Setup GCC uses: egor-tensin/setup-gcc@a2861a8b8538f49cf2850980acccf6b05a1b2ae4 # v2.0 with: version: 10 platform: x64 if: env.DISABLED != 'yes' - name: Setup Node.js environment uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 with: node-version-file: '.nvmrc' if: env.DISABLED != 'yes' - name: Setup Python 3 uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: '3.11' if: env.DISABLED != 'yes' - name: Install libkrb5-dev run: sudo apt-get update -y && sudo apt-get install -y libkrb5-dev if: env.DISABLED != 'yes' - name: Install GH run: ./build/linux/install_gh.sh if: env.DISABLED != 'yes' - name: Download vscode artifact uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: vscode if: env.DISABLED != 'yes' && (env.SHOULD_BUILD_REH != 'no' || env.SHOULD_BUILD_REH_WEB != 'no' || github.event.inputs.generate_assets == 'true') - name: Build env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} npm_config_arch: ${{ matrix.npm_arch }} run: ./build/linux/package_reh.sh if: env.DISABLED != 'yes' && (env.SHOULD_BUILD_REH != 'no' || env.SHOULD_BUILD_REH_WEB != 'no' || github.event.inputs.generate_assets == 'true') - name: Upload assets uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: reh-linux-${{ matrix.vscode_arch }} path: assets/ retention-days: 3 if: env.DISABLED != 'yes' && github.event.inputs.generate_assets == 'true' reh_alpine: needs: - compile runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: include: - slug: X64 vscode_arch: x64 npm_arch: x64 - slug: ARM64 vscode_arch: arm64 npm_arch: arm64 env: BUILD_SOURCEVERSION: ${{ needs.compile.outputs.BUILD_SOURCEVERSION }} DISABLED: ${{ vars[format('DISABLE_{0}_ALPINE_REH_{1}', ((github.ref == 'refs/heads/insider' || (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'insider')) && 'INSIDER' || 'STABLE'), matrix.slug)] }} MS_COMMIT: ${{ needs.compile.outputs.MS_COMMIT }} MS_TAG: ${{ needs.compile.outputs.MS_TAG }} OS_NAME: alpine RELEASE_VERSION: ${{ needs.compile.outputs.RELEASE_VERSION }} VSCODE_ARCH: ${{ matrix.vscode_arch }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: ref: ${{ env.GITHUB_BRANCH }} persist-credentials: false - name: Switch to relevant branch env: PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }} run: ./get_pr.sh - name: Setup GCC uses: egor-tensin/setup-gcc@a2861a8b8538f49cf2850980acccf6b05a1b2ae4 # v2.0 with: version: 10 platform: x64 - name: Setup Node.js environment uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 with: node-version-file: '.nvmrc' - name: Install GH run: ./build/linux/install_gh.sh - name: Install libkrb5-dev run: sudo apt-get update -y && sudo apt-get install -y libkrb5-dev - name: Download vscode artifact uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: vscode if: env.DISABLED != 'yes' && (env.SHOULD_BUILD_REH != 'no' || env.SHOULD_BUILD_REH_WEB != 'no' || github.event.inputs.generate_assets == 'true') - name: Build env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} npm_config_arch: ${{ matrix.npm_arch }} run: ./build/alpine/package_reh.sh if: env.DISABLED != 'yes' && (env.SHOULD_BUILD_REH != 'no' || env.SHOULD_BUILD_REH_WEB != 'no' || github.event.inputs.generate_assets == 'true') - name: Upload assets uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: reh-alpine-${{ matrix.vscode_arch }} path: assets/ retention-days: 3 if: env.DISABLED != 'yes' && github.event.inputs.generate_assets == 'true'