ci: split spearheads so they ask for environment when only needed

This commit is contained in:
Baptiste Augrain
2026-04-18 12:36:50 +02:00
parent 27c3b34038
commit 55edf6dfa9
2 changed files with 94 additions and 56 deletions

View File

@@ -6,9 +6,6 @@ on:
new_release: new_release:
type: boolean type: boolean
description: Force new Release description: Force new Release
force_dispatch:
type: boolean
description: Force dispatch
dont_update: dont_update:
type: boolean type: boolean
description: Don't update VSCode description: Don't update VSCode
@@ -18,13 +15,7 @@ on:
schedule: schedule:
- cron: 0 7 * * * - cron: 0 7 * * *
jobs: env:
build:
runs-on: macos-15
environment: publish
permissions:
contents: write # Release
env:
APP_NAME: VSCodium APP_NAME: VSCodium
ASSETS_REPOSITORY: ${{ github.repository }}-insiders ASSETS_REPOSITORY: ${{ github.repository }}-insiders
BINARY_NAME: codium-insiders BINARY_NAME: codium-insiders
@@ -37,6 +28,45 @@ jobs:
VSCODE_LATEST: ${{ github.event.inputs.dont_update == 'true' && 'no' || 'yes' }} VSCODE_LATEST: ${{ github.event.inputs.dont_update == 'true' && 'no' || 'yes' }}
VSCODE_QUALITY: insider VSCODE_QUALITY: insider
jobs:
check:
runs-on: macos-15
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: insider
persist-credentials: false
- name: Clone VSCode repo
run: . get_repo.sh
- name: Check existing VSCodium tags/releases
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NEW_RELEASE: ${{ github.event.inputs.new_release }}
IS_SPEARHEAD: 'yes'
run: . check_tags.sh
build:
needs:
- check
runs-on: macos-15
environment: publish
permissions:
contents: write # Release
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 }}
if: needs.check.outputs.SHOULD_BUILD == 'yes'
steps: steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: with:
@@ -51,18 +81,10 @@ jobs:
- name: Clone VSCode repo - name: Clone VSCode repo
run: . get_repo.sh run: . get_repo.sh
- name: Check existing VSCodium tags/releases
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NEW_RELEASE: ${{ github.event.inputs.new_release }}
IS_SPEARHEAD: 'yes'
run: . check_tags.sh
- name: Build - name: Build
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./build.sh run: ./build.sh
if: env.SHOULD_BUILD == 'yes'
- name: Import GPG key - name: Import GPG key
uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7.0.0 uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7.0.0
@@ -71,32 +93,29 @@ jobs:
passphrase: ${{ secrets.GPG_PASSPHRASE }} passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true git_user_signingkey: true
git_commit_gpgsign: true git_commit_gpgsign: true
if: env.SHOULD_BUILD == 'yes' && github.event.inputs.dont_update != 'true' if: github.event.inputs.dont_update != 'true'
- name: Update upstream version - name: Update upstream version
run: ./update_upstream.sh run: ./update_upstream.sh
if: env.SHOULD_BUILD == 'yes' && github.event.inputs.dont_update != 'true' if: github.event.inputs.dont_update != 'true'
- name: Prepare source - name: Prepare source
run: ./prepare_src.sh run: ./prepare_src.sh
if: env.SHOULD_BUILD == 'yes'
- name: Upload sourcemaps - name: Upload sourcemaps
env: env:
GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
GITHUB_USERNAME: ${{ github.repository_owner }} GITHUB_USERNAME: ${{ github.repository_owner }}
run: ./upload_sourcemaps.sh run: ./upload_sourcemaps.sh
if: env.SHOULD_BUILD == 'yes'
- name: Release source - name: Release source
env: env:
GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
GITHUB_USERNAME: ${{ github.repository_owner }} GITHUB_USERNAME: ${{ github.repository_owner }}
run: ./release.sh run: ./release.sh
if: env.SHOULD_BUILD == 'yes'
- name: Dispatch builds - name: Dispatch builds
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1 uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1
with: with:
event-type: publish-insider event-type: publish-insider
if: github.event.inputs.dont_dispatch != 'true' && (env.SHOULD_BUILD == 'yes' || github.event.inputs.force_dispatch == 'true') if: github.event.inputs.dont_dispatch != 'true'

View File

@@ -6,9 +6,6 @@ on:
new_release: new_release:
type: boolean type: boolean
description: Force new Release description: Force new Release
force_dispatch:
type: boolean
description: Force dispatch
dont_update: dont_update:
type: boolean type: boolean
description: Don't update VSCode description: Don't update VSCode
@@ -18,13 +15,7 @@ on:
schedule: schedule:
- cron: 0 18 * * * - cron: 0 18 * * *
jobs: env:
build:
runs-on: macos-15
environment: publish
permissions:
contents: write # Release
env:
APP_NAME: VSCodium APP_NAME: VSCodium
ASSETS_REPOSITORY: ${{ github.repository }} ASSETS_REPOSITORY: ${{ github.repository }}
BINARY_NAME: codium BINARY_NAME: codium
@@ -37,6 +28,45 @@ jobs:
VSCODE_LATEST: ${{ github.event.inputs.dont_update == 'true' && 'no' || 'yes' }} VSCODE_LATEST: ${{ github.event.inputs.dont_update == 'true' && 'no' || 'yes' }}
VSCODE_QUALITY: stable VSCODE_QUALITY: stable
jobs:
check:
runs-on: macos-15
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: master
persist-credentials: false
- name: Clone VSCode repo
run: . get_repo.sh
- name: Check existing VSCodium tags/releases
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NEW_RELEASE: ${{ github.event.inputs.new_release }}
IS_SPEARHEAD: 'yes'
run: . check_tags.sh
build:
needs:
- check
runs-on: macos-15
environment: publish
permissions:
contents: write # Release
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 }}
if: needs.check.outputs.SHOULD_BUILD == 'yes'
steps: steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: with:
@@ -51,18 +81,10 @@ jobs:
- name: Clone VSCode repo - name: Clone VSCode repo
run: . get_repo.sh run: . get_repo.sh
- name: Check existing VSCodium tags/releases
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NEW_RELEASE: ${{ github.event.inputs.new_release }}
IS_SPEARHEAD: 'yes'
run: . check_tags.sh
- name: Build - name: Build
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./build.sh run: ./build.sh
if: env.SHOULD_BUILD == 'yes'
- name: Import GPG key - name: Import GPG key
uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7.0.0 uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7.0.0
@@ -71,32 +93,29 @@ jobs:
passphrase: ${{ secrets.GPG_PASSPHRASE }} passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true git_user_signingkey: true
git_commit_gpgsign: true git_commit_gpgsign: true
if: env.SHOULD_BUILD == 'yes' && github.event.inputs.dont_update != 'true' if: github.event.inputs.dont_update != 'true'
- name: Update upstream version - name: Update upstream version
run: ./update_upstream.sh run: ./update_upstream.sh
if: env.SHOULD_BUILD == 'yes' && github.event.inputs.dont_update != 'true' if: github.event.inputs.dont_update != 'true'
- name: Prepare source - name: Prepare source
run: ./prepare_src.sh run: ./prepare_src.sh
if: env.SHOULD_BUILD == 'yes'
- name: Upload sourcemaps - name: Upload sourcemaps
env: env:
GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
GITHUB_USERNAME: ${{ github.repository_owner }} GITHUB_USERNAME: ${{ github.repository_owner }}
run: ./upload_sourcemaps.sh run: ./upload_sourcemaps.sh
if: env.SHOULD_BUILD == 'yes'
- name: Release source - name: Release source
env: env:
GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
GITHUB_USERNAME: ${{ github.repository_owner }} GITHUB_USERNAME: ${{ github.repository_owner }}
run: ./release.sh run: ./release.sh
if: env.SHOULD_BUILD == 'yes'
- name: Dispatch builds - name: Dispatch builds
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1 uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1
with: with:
event-type: publish-stable event-type: publish-stable
if: github.event.inputs.dont_dispatch != 'true' && (env.SHOULD_BUILD == 'yes' || github.event.inputs.force_dispatch == 'true') if: github.event.inputs.dont_dispatch != 'true'