2021-10-19 19:58:55 +08:00
|
|
|
pool:
|
|
|
|
vmImage: "ubuntu-latest"
|
|
|
|
|
2019-04-08 17:56:54 +08:00
|
|
|
trigger:
|
|
|
|
branches:
|
2021-02-15 03:10:24 +08:00
|
|
|
include: ["main", "release/*"]
|
2022-05-11 23:26:15 +08:00
|
|
|
pr: none
|
2019-04-08 17:56:54 +08:00
|
|
|
|
2019-04-08 17:49:07 +08:00
|
|
|
steps:
|
2020-11-24 18:44:18 +08:00
|
|
|
- task: NodeTool@0
|
|
|
|
inputs:
|
2022-03-10 23:51:37 +08:00
|
|
|
versionSpec: "16.x"
|
2019-04-08 17:49:07 +08:00
|
|
|
|
2022-08-12 06:55:57 +08:00
|
|
|
- task: AzureKeyVault@1
|
|
|
|
displayName: "Azure Key Vault: Get Secrets"
|
|
|
|
inputs:
|
|
|
|
azureSubscription: "vscode-builds-subscription"
|
2022-11-11 16:38:36 +08:00
|
|
|
KeyVaultName: vscode-build-secrets
|
2022-08-12 06:55:57 +08:00
|
|
|
SecretsFilter: "github-distro-mixin-password"
|
|
|
|
|
2020-11-24 18:44:18 +08:00
|
|
|
- script: |
|
|
|
|
set -e
|
2019-04-08 17:49:07 +08:00
|
|
|
|
2022-08-12 06:55:57 +08:00
|
|
|
cat << EOF > ~/.netrc
|
|
|
|
machine github.com
|
|
|
|
login vscode
|
|
|
|
password $(github-distro-mixin-password)
|
|
|
|
EOF
|
|
|
|
|
2020-11-24 18:44:18 +08:00
|
|
|
git config user.email "vscode@microsoft.com"
|
|
|
|
git config user.name "VSCode"
|
2019-04-08 17:49:07 +08:00
|
|
|
|
2020-11-24 18:44:18 +08:00
|
|
|
git remote add distro "https://github.com/$VSCODE_MIXIN_REPO.git"
|
|
|
|
git fetch distro
|
2019-07-02 17:14:26 +08:00
|
|
|
|
2021-02-15 03:10:24 +08:00
|
|
|
# Push main branch into oss/main
|
|
|
|
git push distro origin/main:refs/heads/oss/main
|
2019-07-02 17:14:26 +08:00
|
|
|
|
2020-11-24 18:44:18 +08:00
|
|
|
# Push every release branch into oss/release
|
|
|
|
git for-each-ref --format="%(refname:short)" refs/remotes/origin/release/* | sed 's/^origin\/\(.*\)$/\0:refs\/heads\/oss\/\1/' | xargs git push distro
|
2019-07-02 17:14:26 +08:00
|
|
|
|
2020-11-24 18:44:18 +08:00
|
|
|
git merge $(node -p "require('./package.json').distro")
|
2019-04-08 17:49:07 +08:00
|
|
|
|
2020-11-24 18:44:18 +08:00
|
|
|
displayName: Sync & Merge Distro
|