mirror of
https://github.com/VSCodium/vscodium.git
synced 2026-04-17 21:24:40 +10:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c71f2250ce | ||
|
|
b0154c7831 | ||
|
|
23313d41ba | ||
|
|
cf48030b59 | ||
|
|
848aabfe54 | ||
|
|
10a0cb4b30 | ||
|
|
0469329683 | ||
|
|
6acd2fbfe1 | ||
|
|
38810539a7 |
2
.github/workflows/linux.yml
vendored
2
.github/workflows/linux.yml
vendored
@@ -88,7 +88,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
env:
|
env:
|
||||||
GH_CLI_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: ./release.sh
|
run: ./release.sh
|
||||||
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
|
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/macos.yml
vendored
2
.github/workflows/macos.yml
vendored
@@ -95,7 +95,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
env:
|
env:
|
||||||
GH_CLI_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: ./release.sh
|
run: ./release.sh
|
||||||
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
|
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/windows.yml
vendored
2
.github/workflows/windows.yml
vendored
@@ -82,7 +82,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
env:
|
env:
|
||||||
GH_CLI_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: ./release.sh
|
run: ./release.sh
|
||||||
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
|
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
|
||||||
|
|
||||||
|
|||||||
1
build.sh
1
build.sh
@@ -25,7 +25,6 @@ if [[ "${SHOULD_BUILD}" == "yes" ]]; then
|
|||||||
. ../build/windows/rtf/make.sh
|
. ../build/windows/rtf/make.sh
|
||||||
|
|
||||||
yarn gulp "vscode-win32-${VSCODE_ARCH}-min-ci"
|
yarn gulp "vscode-win32-${VSCODE_ARCH}-min-ci"
|
||||||
yarn gulp "vscode-win32-${VSCODE_ARCH}-code-helper"
|
|
||||||
yarn gulp "vscode-win32-${VSCODE_ARCH}-inno-updater"
|
yarn gulp "vscode-win32-${VSCODE_ARCH}-inno-updater"
|
||||||
|
|
||||||
if [[ "${SHOULD_BUILD_ZIP}" != "no" ]]; then
|
if [[ "${SHOULD_BUILD_ZIP}" != "no" ]]; then
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
diff --git a/src/vs/base/common/product.ts b/src/vs/base/common/product.ts
|
diff --git a/src/vs/base/common/product.ts b/src/vs/base/common/product.ts
|
||||||
index 78d6060..dfa9de2 100644
|
index 657b9c9..9b9b12e 100644
|
||||||
--- a/src/vs/base/common/product.ts
|
--- a/src/vs/base/common/product.ts
|
||||||
+++ b/src/vs/base/common/product.ts
|
+++ b/src/vs/base/common/product.ts
|
||||||
@@ -69,6 +69,7 @@ export interface IProductConfiguration {
|
@@ -70,6 +70,7 @@ export interface IProductConfiguration {
|
||||||
|
|
||||||
readonly extensionsGallery?: {
|
readonly extensionsGallery?: {
|
||||||
readonly serviceUrl: string;
|
readonly serviceUrl: string;
|
||||||
@@ -11,7 +11,7 @@ index 78d6060..dfa9de2 100644
|
|||||||
readonly resourceUrlTemplate: string;
|
readonly resourceUrlTemplate: string;
|
||||||
readonly controlUrl: string;
|
readonly controlUrl: string;
|
||||||
diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts
|
diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts
|
||||||
index 09dfc64..fec0cfa 100644
|
index 5e38d35..12bb161 100644
|
||||||
--- a/src/vs/platform/product/common/product.ts
|
--- a/src/vs/platform/product/common/product.ts
|
||||||
+++ b/src/vs/platform/product/common/product.ts
|
+++ b/src/vs/platform/product/common/product.ts
|
||||||
@@ -4,11 +4,12 @@
|
@@ -4,11 +4,12 @@
|
||||||
@@ -26,9 +26,9 @@ index 09dfc64..fec0cfa 100644
|
|||||||
import { ISandboxConfiguration } from 'vs/base/parts/sandbox/common/sandboxTypes';
|
import { ISandboxConfiguration } from 'vs/base/parts/sandbox/common/sandboxTypes';
|
||||||
+import { getUserDataPath } from 'vs/platform/environment/node/userDataPath';
|
+import { getUserDataPath } from 'vs/platform/environment/node/userDataPath';
|
||||||
|
|
||||||
let product: IProductConfiguration;
|
/**
|
||||||
|
* @deprecated You MUST use `IProductService` if possible.
|
||||||
@@ -31,6 +32,32 @@ else if (typeof require?.__$__nodeRequire === 'function') {
|
@@ -34,6 +35,32 @@ else if (typeof require?.__$__nodeRequire === 'function') {
|
||||||
product = require.__$__nodeRequire(joinPath(rootPath, 'product.json').fsPath);
|
product = require.__$__nodeRequire(joinPath(rootPath, 'product.json').fsPath);
|
||||||
const pkg = require.__$__nodeRequire(joinPath(rootPath, 'package.json').fsPath) as { version: string; };
|
const pkg = require.__$__nodeRequire(joinPath(rootPath, 'package.json').fsPath) as { version: string; };
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ index 09dfc64..fec0cfa 100644
|
|||||||
// Running out of sources
|
// Running out of sources
|
||||||
if (env['VSCODE_DEV']) {
|
if (env['VSCODE_DEV']) {
|
||||||
Object.assign(product, {
|
Object.assign(product, {
|
||||||
@@ -40,6 +67,19 @@ else if (typeof require?.__$__nodeRequire === 'function') {
|
@@ -43,6 +70,19 @@ else if (typeof require?.__$__nodeRequire === 'function') {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
diff --git a/extensions/github-authentication/src/githubServer.ts b/extensions/github-authentication/src/githubServer.ts
|
diff --git a/extensions/github-authentication/src/githubServer.ts b/extensions/github-authentication/src/githubServer.ts
|
||||||
index 8424f5b..5bac245 100644
|
index fe0fbfd..656d8bb 100644
|
||||||
--- a/extensions/github-authentication/src/githubServer.ts
|
--- a/extensions/github-authentication/src/githubServer.ts
|
||||||
+++ b/extensions/github-authentication/src/githubServer.ts
|
+++ b/extensions/github-authentication/src/githubServer.ts
|
||||||
@@ -6,8 +6,6 @@
|
@@ -6,8 +6,6 @@
|
||||||
@@ -47,7 +47,7 @@ index 8424f5b..5bac245 100644
|
|||||||
private _statusBarCommandId = `${this.type}.provide-manually`;
|
private _statusBarCommandId = `${this.type}.provide-manually`;
|
||||||
private _disposable: vscode.Disposable;
|
private _disposable: vscode.Disposable;
|
||||||
private _uriHandler = new UriEventHandler(this._logger);
|
private _uriHandler = new UriEventHandler(this._logger);
|
||||||
@@ -115,150 +99,35 @@ export class GitHubServer implements IGitHubServer {
|
@@ -115,137 +99,35 @@ export class GitHubServer implements IGitHubServer {
|
||||||
this._disposable.dispose();
|
this._disposable.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,15 +58,13 @@ index 8424f5b..5bac245 100644
|
|||||||
- // TODO@joaomoreno TODO@TylerLeonhardt
|
- // TODO@joaomoreno TODO@TylerLeonhardt
|
||||||
- private async isNoCorsEnvironment(): Promise<boolean> {
|
- private async isNoCorsEnvironment(): Promise<boolean> {
|
||||||
- const uri = await vscode.env.asExternalUri(vscode.Uri.parse(`${vscode.env.uriScheme}://vscode.github-authentication/dummy`));
|
- const uri = await vscode.env.asExternalUri(vscode.Uri.parse(`${vscode.env.uriScheme}://vscode.github-authentication/dummy`));
|
||||||
- return (uri.scheme === 'https' && /^(vscode|github)\./.test(uri.authority)) || (uri.scheme === 'http' && /^localhost/.test(uri.authority));
|
- return (uri.scheme === 'https' && /^((insiders\.)?vscode|github)\./.test(uri.authority)) || (uri.scheme === 'http' && /^localhost/.test(uri.authority));
|
||||||
- }
|
- }
|
||||||
-
|
-
|
||||||
public async login(scopes: string): Promise<string> {
|
public async login(scopes: string): Promise<string> {
|
||||||
this._logger.info(`Logging in for the following scopes: ${scopes}`);
|
this._logger.info(`Logging in for the following scopes: ${scopes}`);
|
||||||
|
|
||||||
- // TODO@joaomoreno TODO@TylerLeonhardt
|
- const callbackUri = await vscode.env.asExternalUri(vscode.Uri.parse(`${vscode.env.uriScheme}://vscode.github-authentication/did-authenticate`));
|
||||||
- const nocors = await this.isNoCorsEnvironment();
|
|
||||||
- const callbackUri = await vscode.env.asExternalUri(vscode.Uri.parse(`${vscode.env.uriScheme}://vscode.github-authentication/did-authenticate${nocors ? '?nocors=true' : ''}`));
|
|
||||||
-
|
-
|
||||||
- if (this.isTestEnvironment(callbackUri)) {
|
- if (this.isTestEnvironment(callbackUri)) {
|
||||||
- const token = await vscode.window.showInputBox({ prompt: 'GitHub Personal Access Token', ignoreFocusOut: true });
|
- const token = await vscode.window.showInputBox({ prompt: 'GitHub Personal Access Token', ignoreFocusOut: true });
|
||||||
@@ -86,7 +84,7 @@ index 8424f5b..5bac245 100644
|
|||||||
- return tokenScopes.includes(splitScopes);
|
- return tokenScopes.includes(splitScopes);
|
||||||
- });
|
- });
|
||||||
- })) {
|
- })) {
|
||||||
- throw new Error(`The provided token is does not match the requested scopes: ${scopes}`);
|
- throw new Error(`The provided token does not match the requested scopes: ${scopes}`);
|
||||||
+ const tokenScopes = await getScopes(token, this.getServerUri('/'), this._logger); // Example: ['repo', 'user']
|
+ const tokenScopes = await getScopes(token, this.getServerUri('/'), this._logger); // Example: ['repo', 'user']
|
||||||
+ const scopesList = scopes.split(' '); // Example: 'read:user repo user:email'
|
+ const scopesList = scopes.split(' '); // Example: 'read:user repo user:email'
|
||||||
+ if (!scopesList.every(scope => {
|
+ if (!scopesList.every(scope => {
|
||||||
@@ -104,7 +102,7 @@ index 8424f5b..5bac245 100644
|
|||||||
- const existingStates = this._pendingStates.get(scopes) || [];
|
- const existingStates = this._pendingStates.get(scopes) || [];
|
||||||
- this._pendingStates.set(scopes, [...existingStates, state]);
|
- this._pendingStates.set(scopes, [...existingStates, state]);
|
||||||
-
|
-
|
||||||
- const uri = vscode.Uri.parse(`https://${AUTH_RELAY_SERVER}/authorize/?callbackUri=${encodeURIComponent(callbackUri.toString())}&scope=${scopes}&state=${state}&responseType=code&authServer=https://github.com${nocors ? '&nocors=true' : ''}`);
|
- const uri = vscode.Uri.parse(`https://${AUTH_RELAY_SERVER}/authorize/?callbackUri=${encodeURIComponent(callbackUri.toString())}&scope=${scopes}&state=${state}&responseType=code&authServer=https://github.com`);
|
||||||
- await vscode.env.openExternal(uri);
|
- await vscode.env.openExternal(uri);
|
||||||
-
|
-
|
||||||
- // Register a single listener for the URI callback, in case the user starts the login process multiple times
|
- // Register a single listener for the URI callback, in case the user starts the login process multiple times
|
||||||
@@ -117,7 +115,7 @@ index 8424f5b..5bac245 100644
|
|||||||
+ return tokenScopes.includes(splitScopes);
|
+ return tokenScopes.includes(splitScopes);
|
||||||
+ });
|
+ });
|
||||||
+ })) {
|
+ })) {
|
||||||
+ throw new Error(`The provided token is does not match the requested scopes: ${scopes}`);
|
+ throw new Error(`The provided token does not match the requested scopes: ${scopes}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
- return Promise.race([
|
- return Promise.race([
|
||||||
@@ -158,34 +156,23 @@ index 8424f5b..5bac245 100644
|
|||||||
- const url = `https://${AUTH_RELAY_SERVER}/token?code=${code}&state=${query.state}`;
|
- const url = `https://${AUTH_RELAY_SERVER}/token?code=${code}&state=${query.state}`;
|
||||||
- this._logger.info('Exchanging code for token...');
|
- this._logger.info('Exchanging code for token...');
|
||||||
-
|
-
|
||||||
- // TODO@joao: remove
|
- try {
|
||||||
- if (query.nocors) {
|
- const result = await fetch(url, {
|
||||||
- try {
|
- method: 'POST',
|
||||||
- const json: any = await vscode.commands.executeCommand('_workbench.fetchJSON', url, 'POST');
|
- headers: {
|
||||||
|
- Accept: 'application/json'
|
||||||
|
- }
|
||||||
|
- });
|
||||||
|
-
|
||||||
|
- if (result.ok) {
|
||||||
|
- const json = await result.json();
|
||||||
- this._logger.info('Token exchange success!');
|
- this._logger.info('Token exchange success!');
|
||||||
- resolve(json.access_token);
|
- resolve(json.access_token);
|
||||||
- } catch (err) {
|
- } else {
|
||||||
- reject(err);
|
- reject(result.statusText);
|
||||||
- }
|
|
||||||
- } else {
|
|
||||||
- try {
|
|
||||||
- const result = await fetch(url, {
|
|
||||||
- method: 'POST',
|
|
||||||
- headers: {
|
|
||||||
- Accept: 'application/json'
|
|
||||||
- }
|
|
||||||
- });
|
|
||||||
-
|
|
||||||
- if (result.ok) {
|
|
||||||
- const json = await result.json();
|
|
||||||
- this._logger.info('Token exchange success!');
|
|
||||||
- resolve(json.access_token);
|
|
||||||
- } else {
|
|
||||||
- reject(result.statusText);
|
|
||||||
- }
|
|
||||||
- } catch (ex) {
|
|
||||||
- reject(ex);
|
|
||||||
- }
|
- }
|
||||||
|
- } catch (ex) {
|
||||||
|
- reject(ex);
|
||||||
- }
|
- }
|
||||||
- };
|
- };
|
||||||
-
|
-
|
||||||
@@ -212,7 +199,7 @@ index 8424f5b..5bac245 100644
|
|||||||
private async manuallyProvideUri() {
|
private async manuallyProvideUri() {
|
||||||
const uri = await vscode.window.showInputBox({
|
const uri = await vscode.window.showInputBox({
|
||||||
prompt: 'Uri',
|
prompt: 'Uri',
|
||||||
@@ -290,44 +159,7 @@ export class GitHubServer implements IGitHubServer {
|
@@ -277,44 +159,7 @@ export class GitHubServer implements IGitHubServer {
|
||||||
return getUserInfo(token, this.getServerUri('/user'), this._logger);
|
return getUserInfo(token, this.getServerUri('/user'), this._logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
43
release.sh
43
release.sh
@@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [[ -z "${GH_CLI_TOKEN}" ]]; then
|
if [[ -z "${GITHUB_TOKEN}" ]]; then
|
||||||
echo "Will not release because no GH_CLI_TOKEN defined"
|
echo "Will not release because no GITHUB_TOKEN defined"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "${GH_CLI_TOKEN}" | gh auth login --with-token
|
npm install -g github-release-cli
|
||||||
|
|
||||||
if [[ $( gh release view "${MS_TAG}" 2>&1 ) =~ "release not found" ]]; then
|
if [[ $( gh release view "${MS_TAG}" 2>&1 ) =~ "release not found" ]]; then
|
||||||
echo "Creating release '${MS_TAG}'"
|
echo "Creating release '${MS_TAG}'"
|
||||||
@@ -16,11 +16,46 @@ fi
|
|||||||
|
|
||||||
cd artifacts
|
cd artifacts
|
||||||
|
|
||||||
|
set +e
|
||||||
|
|
||||||
for FILE in *
|
for FILE in *
|
||||||
do
|
do
|
||||||
if [[ -f "${FILE}" ]] && [[ "${FILE}" != *.sha1 ]] && [[ "${FILE}" != *.sha256 ]]; then
|
if [[ -f "${FILE}" ]] && [[ "${FILE}" != *.sha1 ]] && [[ "${FILE}" != *.sha256 ]]; then
|
||||||
echo "Uploading '${FILE}'"
|
echo "::group::Uploading '${FILE}' at $( date "+%T" )"
|
||||||
gh release upload "${MS_TAG}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
|
gh release upload "${MS_TAG}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
|
||||||
|
|
||||||
|
EXIT_STATUS=$?
|
||||||
|
echo "exit: $EXIT_STATUS"
|
||||||
|
|
||||||
|
if (( $EXIT_STATUS )); then
|
||||||
|
for (( i=0; i<10; i++ ))
|
||||||
|
do
|
||||||
|
github-release delete --owner VSCodium --repo vscodium --tag "${MS_TAG}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
|
||||||
|
|
||||||
|
sleep $(( 15 * (i + 1)))
|
||||||
|
|
||||||
|
echo "RE-Uploading '${FILE}' at $( date "+%T" )"
|
||||||
|
gh release upload "${MS_TAG}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
|
||||||
|
|
||||||
|
EXIT_STATUS=$?
|
||||||
|
echo "exit: $EXIT_STATUS"
|
||||||
|
|
||||||
|
if ! (( $EXIT_STATUS )); then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo "exit: $EXIT_STATUS"
|
||||||
|
|
||||||
|
if (( $EXIT_STATUS )); then
|
||||||
|
echo "'${FILE}' hasn't been uploaded!"
|
||||||
|
|
||||||
|
github-release delete --owner VSCodium --repo vscodium --tag "${MS_TAG}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
|
||||||
|
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "::endgroup::"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user