Publish - Insider - Windows #14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish - Insider - Windows | |
| on: | |
| workflow_dispatch: {} | |
| repository_dispatch: | |
| types: | |
| - publish-insider | |
| env: | |
| APP_NAME: VSCodium | |
| ASSETS_REPOSITORY: ${{ github.repository }}-insiders | |
| BINARY_NAME: codium-insiders | |
| GH_REPO_PATH: ${{ github.repository }} | |
| GITHUB_BRANCH: insider | |
| ORG_NAME: ${{ github.repository_owner }} | |
| OS_NAME: windows | |
| VERSIONS_REPOSITORY: ${{ github.repository_owner }}/versions | |
| VSCODE_QUALITY: insider | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| permissions: {} | |
| outputs: | |
| MS_COMMIT: ${{ env.MS_COMMIT }} | |
| MS_TAG: ${{ env.MS_TAG }} | |
| RELEASE_VERSION: ${{ env.RELEASE_VERSION }} | |
| SHOULD_BUILD: ${{ env.SHOULD_BUILD }} | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| ref: ${{ env.GITHUB_BRANCH }} | |
| persist-credentials: false | |
| - name: Clone VSCode repo | |
| run: ./get_repo.sh | |
| - name: Check existing VSCodium tags/releases | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| CHECK_ALL: yes | |
| run: ./check_tags.sh | |
| compile: | |
| needs: | |
| - check | |
| runs-on: windows-2022 | |
| permissions: {} | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| MS_COMMIT: ${{ needs.check.outputs.MS_COMMIT }} | |
| MS_TAG: ${{ needs.check.outputs.MS_TAG }} | |
| RELEASE_VERSION: ${{ needs.check.outputs.RELEASE_VERSION }} | |
| SHOULD_BUILD: ${{ needs.check.outputs.SHOULD_BUILD }} | |
| VSCODE_ARCH: x64 | |
| outputs: | |
| BUILD_SOURCEVERSION: ${{ env.BUILD_SOURCEVERSION }} | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| ref: ${{ env.GITHUB_BRANCH }} | |
| persist-credentials: false | |
| if: env.SHOULD_BUILD == 'yes' | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version-file: .nvmrc | |
| if: env.SHOULD_BUILD == 'yes' | |
| - name: Setup Python 3 | |
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 | |
| with: | |
| python-version: "3.11" | |
| if: env.SHOULD_BUILD == 'yes' | |
| - name: Clone VSCode repo | |
| run: ./get_repo.sh | |
| if: env.SHOULD_BUILD == 'yes' | |
| - name: Build | |
| env: | |
| SHOULD_BUILD_REH: no | |
| SHOULD_BUILD_REH_WEB: no | |
| run: ./build.sh | |
| if: env.SHOULD_BUILD == 'yes' | |
| - 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 | |
| if: env.SHOULD_BUILD == 'yes' | |
| - name: Upload vscode artifact | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: vscode | |
| path: ./vscode.tar.gz | |
| retention-days: 30 | |
| if: env.SHOULD_BUILD == 'yes' | |
| build: | |
| needs: | |
| - check | |
| - compile | |
| runs-on: windows-2022 | |
| environment: publish-windows | |
| permissions: | |
| contents: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| vscode_arch: | |
| - x64 | |
| - arm64 | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| BUILD_SOURCEVERSION: ${{ needs.compile.outputs.BUILD_SOURCEVERSION }} | |
| MS_COMMIT: ${{ needs.check.outputs.MS_COMMIT }} | |
| MS_TAG: ${{ needs.check.outputs.MS_TAG }} | |
| RELEASE_VERSION: ${{ needs.check.outputs.RELEASE_VERSION }} | |
| SHOULD_BUILD: ${{ needs.check.outputs.SHOULD_BUILD }} | |
| VSCODE_ARCH: ${{ matrix.vscode_arch }} | |
| outputs: | |
| RELEASE_VERSION: ${{ env.RELEASE_VERSION }} | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| ref: ${{ env.GITHUB_BRANCH }} | |
| persist-credentials: false | |
| if: env.SHOULD_BUILD == 'yes' | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version-file: '.nvmrc' | |
| if: env.SHOULD_BUILD == 'yes' | |
| - name: Setup Python 3 | |
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 | |
| with: | |
| python-version: '3.11' | |
| if: env.SHOULD_BUILD == 'yes' | |
| - name: Check existing VSCodium tags/releases | |
| env: | |
| DISABLE_MSI: ${{ vars.DISABLE_INSIDER_MSI }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: ./check_tags.sh | |
| if: env.SHOULD_BUILD == 'yes' | |
| - name: Download vscode artifact | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: vscode | |
| 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/windows/package.sh | |
| if: env.SHOULD_BUILD == 'yes' | |
| - name: Prepare assets | |
| run: ./prepare_assets.sh | |
| if: env.SHOULD_BUILD == 'yes' | |
| - name: Upload unsigned artifacts | |
| id: upload-unsigned-artifacts | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: unsigned-${{ matrix.vscode_arch }} | |
| path: | | |
| assets/*.exe | |
| assets/*.msi | |
| retention-days: 1 | |
| if: env.SHOULD_BUILD == 'yes' && vars.DISABLE_INSIDER_WINDOWS_SIGNING != 'yes' | |
| - name: Signing | |
| uses: signpath/github-action-submit-signing-request@b9d91eadd323de506c0c81cf0c7fe7438f3360fd # v2 | |
| with: | |
| api-token: ${{ secrets.SIGNPATH_API_TOKEN }} | |
| organization-id: ${{ secrets.SIGNPATH_ORGANIZATION_ID }} | |
| project-slug: ${{ secrets.SIGNPATH_PROJECT_SLUG }} | |
| signing-policy-slug: ${{ secrets.SIGNPATH_POLICY_SLUG }} | |
| github-artifact-id: ${{ steps.upload-unsigned-artifacts.outputs.artifact-id }} | |
| artifact-configuration-slug: ${{ matrix.vscode_arch }} | |
| wait-for-completion: true | |
| # 3h to manually approve the request | |
| wait-for-completion-timeout-in-seconds: 28800 | |
| output-artifact-directory: assets/ | |
| if: env.SHOULD_BUILD == 'yes' && vars.DISABLE_INSIDER_WINDOWS_SIGNING != 'yes' | |
| - name: Prepare checksums | |
| run: ./prepare_checksums.sh | |
| if: env.SHOULD_BUILD == 'yes' | |
| - name: Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }} | |
| GITHUB_USERNAME: ${{ github.repository_owner }} | |
| run: ./release.sh | |
| if: env.SHOULD_BUILD == 'yes' | |
| - name: Update versions repo | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }} | |
| GITHUB_USERNAME: ${{ github.repository_owner }} | |
| run: ./update_version.sh | |
| if: env.SHOULD_BUILD == 'yes' | |
| winget: | |
| needs: build | |
| runs-on: windows-2022 | |
| environment: publish | |
| permissions: | |
| contents: write | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| APP_IDENTIFIER: VSCodium.VSCodium.Insiders | |
| ASSETS_REPOSITORY: vscodium-insiders | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| ref: ${{ env.GITHUB_BRANCH }} | |
| persist-credentials: false | |
| - name: Check version | |
| run: ./stores/winget/check_version.sh | |
| env: | |
| RELEASE_VERSION: ${{ needs.build.outputs.RELEASE_VERSION }} | |
| - name: Release to WinGet | |
| uses: vedantmgoyal9/winget-releaser@4ffc7888bffd451b357355dc214d43bb9f23917e | |
| with: | |
| identifier: ${{ env.APP_IDENTIFIER }} | |
| version: ${{ env.RELEASE_VERSION }} | |
| release-repository: ${{ env.ASSETS_REPOSITORY }} | |
| release-tag: ${{ env.RELEASE_VERSION }}-insider | |
| installers-regex: '\.exe$' # only .exe files | |
| token: ${{ secrets.STRONGER_GITHUB_TOKEN }} | |
| if: env.SHOULD_DEPLOY == 'yes' |