Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: correctly build pr to generate assets #2051

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions .github/workflows/insider-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ jobs:
with:
ref: ${{ env.GITHUB_BRANCH }}

- name: Clone VSCode repo
- name: Switch to relevant branch
env:
PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
run: ./get_pr.sh

- name: Clone VSCode repo
run: ./get_repo.sh

- name: Check PR or cron
Expand Down Expand Up @@ -84,6 +87,11 @@ jobs:
ref: ${{ env.GITHUB_BRANCH }}
if: env.SHOULD_BUILD == 'yes'

- name: Switch to relevant branch
env:
PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
run: ./get_pr.sh

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
Expand All @@ -105,8 +113,6 @@ jobs:
if: env.SHOULD_BUILD == 'yes'

- name: Clone VSCode repo
env:
PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
run: ./get_repo.sh
if: env.SHOULD_BUILD == 'yes'

Expand Down Expand Up @@ -175,6 +181,11 @@ jobs:
ref: ${{ env.GITHUB_BRANCH }}
if: env.SHOULD_BUILD == 'yes'

- name: Switch to relevant branch
env:
PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
run: ./get_pr.sh

- name: Install GH
run: ./install_gh.sh
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
Expand Down Expand Up @@ -268,6 +279,11 @@ jobs:
with:
ref: ${{ env.GITHUB_BRANCH }}

- name: Switch to relevant branch
env:
PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
run: ./get_pr.sh

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -348,6 +364,11 @@ jobs:
with:
ref: ${{ env.GITHUB_BRANCH }}

- name: Switch to relevant branch
env:
PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
run: ./get_pr.sh

- name: Install GH
run: ./install_gh.sh
if: env.SHOULD_DEPLOY == 'yes'
Expand Down Expand Up @@ -436,6 +457,13 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.GITHUB_BRANCH }}

- name: Switch to relevant branch
env:
PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
run: ./get_pr.sh

- uses: docker/setup-qemu-action@v3

Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/insider-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ jobs:
with:
ref: ${{ env.GITHUB_BRANCH }}

- name: Switch to relevant branch
env:
PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
run: ./get_pr.sh

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
Expand All @@ -63,8 +68,6 @@ jobs:
if: env.VSCODE_ARCH == 'x64'

- name: Clone VSCode repo
env:
PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
run: . get_repo.sh

- name: Check PR or cron
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/insider-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ jobs:
with:
ref: ${{ env.GITHUB_BRANCH }}

- name: Switch to relevant branch
env:
PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
run: ./get_pr.sh

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
Expand All @@ -69,8 +74,6 @@ jobs:
python-version: '3.11'

- name: Clone VSCode repo
env:
PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
run: ./get_repo.sh

- name: Check PR or cron
Expand Down
34 changes: 31 additions & 3 deletions .github/workflows/stable-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,12 @@ jobs:
with:
ref: ${{ env.GITHUB_BRANCH }}

- name: Clone VSCode repo
- name: Switch to relevant branch
env:
PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
run: ./get_pr.sh

- name: Clone VSCode repo
run: ./get_repo.sh

- name: Check PR or cron
Expand Down Expand Up @@ -83,6 +86,11 @@ jobs:
ref: ${{ env.GITHUB_BRANCH }}
if: env.SHOULD_BUILD == 'yes'

- name: Switch to relevant branch
env:
PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
run: ./get_pr.sh

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
Expand All @@ -104,8 +112,6 @@ jobs:
if: env.SHOULD_BUILD == 'yes'

- name: Clone VSCode repo
env:
PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
run: ./get_repo.sh
if: env.SHOULD_BUILD == 'yes'

Expand Down Expand Up @@ -174,6 +180,11 @@ jobs:
ref: ${{ env.GITHUB_BRANCH }}
if: env.SHOULD_BUILD == 'yes'

- name: Switch to relevant branch
env:
PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
run: ./get_pr.sh

- name: Install GH
run: ./install_gh.sh
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
Expand Down Expand Up @@ -267,6 +278,11 @@ jobs:
with:
ref: ${{ env.GITHUB_BRANCH }}

- name: Switch to relevant branch
env:
PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
run: ./get_pr.sh

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -347,6 +363,11 @@ jobs:
with:
ref: ${{ env.GITHUB_BRANCH }}

- name: Switch to relevant branch
env:
PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
run: ./get_pr.sh

- name: Install GH
run: ./install_gh.sh
if: env.SHOULD_DEPLOY == 'yes'
Expand Down Expand Up @@ -432,6 +453,13 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.GITHUB_BRANCH }}

- name: Switch to relevant branch
env:
PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
run: ./get_pr.sh

- name: Check version
env:
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/stable-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.GITHUB_BRANCH }}

- name: Switch to relevant branch
env:
PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
run: ./get_pr.sh

- name: Setup Node.js environment
uses: actions/setup-node@v4
Expand All @@ -60,8 +67,6 @@ jobs:
if: env.VSCODE_ARCH == 'x64'

- name: Clone VSCode repo
env:
PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
run: . get_repo.sh

- name: Check PR or cron
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/stable-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.GITHUB_BRANCH }}

- name: Switch to relevant branch
env:
PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
run: ./get_pr.sh

- name: Setup Node.js environment
uses: actions/setup-node@v4
Expand All @@ -67,8 +74,6 @@ jobs:
python-version: '3.11'

- name: Clone VSCode repo
env:
PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
run: ./get_repo.sh

- name: Check PR or cron
Expand All @@ -85,7 +90,6 @@ jobs:
- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_USERNAME: ${{ github.repository_owner }}
npm_config_arch: ${{ matrix.vscode_arch }}
npm_config_target_arch: ${{ matrix.vscode_arch }}
run: ./build.sh
Expand Down Expand Up @@ -129,6 +133,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.GITHUB_BRANCH }}

- name: Check version
run: ./stores/winget/check_version.sh
Expand Down
14 changes: 14 additions & 0 deletions get_pr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

set -e

if [[ -n "${PULL_REQUEST_ID}" ]]; then
BRANCH_NAME=$( git rev-parse --abbrev-ref HEAD )

git config --global user.email "$( echo "${GITHUB_USERNAME}" | awk '{print tolower($0)}' )-ci@not-real.com"
git config --global user.name "${GITHUB_USERNAME} CI"
git fetch --unshallow
git fetch origin "pull/${PULL_REQUEST_ID}/head"
git checkout FETCH_HEAD
git merge --no-edit "origin/${BRANCH_NAME}"
fi
11 changes: 0 additions & 11 deletions get_repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,6 @@ if [[ "${CI_BUILD}" != "no" ]]; then
git config --global --add safe.directory "/__w/$( echo "${GITHUB_REPOSITORY}" | awk '{print tolower($0)}' )"
fi

if [[ -n "${PULL_REQUEST_ID}" ]]; then
BRANCH_NAME=$( git rev-parse --abbrev-ref HEAD )

git config --global user.email "$( echo "${GITHUB_USERNAME}" | awk '{print tolower($0)}' )-ci@not-real.com"
git config --global user.name "${GITHUB_USERNAME} CI"
git fetch --unshallow
git fetch origin "pull/${PULL_REQUEST_ID}/head"
git checkout FETCH_HEAD
git merge --no-edit "origin/${BRANCH_NAME}"
fi

if [[ -z "${RELEASE_VERSION}" ]]; then
if [[ "${VSCODE_LATEST}" == "yes" ]] || [[ ! -f "${VSCODE_QUALITY}.json" ]]; then
echo "Retrieve lastest version"
Expand Down
Loading