Skip to content

Commit 44acfaf

Browse files
authored
Merge pull request #260 from microsoft/master
[Release] Create new release
2 parents 22bd06d + b9084dd commit 44acfaf

File tree

54 files changed

+1030
-515
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1030
-515
lines changed

.github/configure_repoclient.py

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
from os import environ as env
2+
import json
3+
4+
def check_var(name:str) -> bool:
5+
if name not in env:
6+
print(f"Required env var {name} is missing!")
7+
exit(1)
8+
9+
for var in ['APT_REPO_ID', 'AZURE_AAD_ID', 'AAD_CLIENT_SECRET']:
10+
check_var(var)
11+
12+
repo_id = env['APT_REPO_ID']
13+
aad_id = env['AZURE_AAD_ID']
14+
password = env['AAD_CLIENT_SECRET']
15+
16+
repo_config = {
17+
"AADResource": "https://microsoft.onmicrosoft.com/945999e9-da09-4b5b-878f-b66c414602c0",
18+
"AADTenant": "72f988bf-86f1-41af-91ab-2d7cd011db47",
19+
"AADAuthorityUrl": "https://login.microsoftonline.com",
20+
"server": "azure-apt-cat.cloudapp.net",
21+
"port": "443",
22+
23+
"repositoryId": repo_id,
24+
"AADClientId": aad_id,
25+
"AADClientSecret": password,
26+
}
27+
28+
configs = [
29+
("config.json", repo_config),
30+
]
31+
32+
for filename, data in configs:
33+
with open(filename, 'w') as fp:
34+
json.dump(data, fp)
35+

.github/fetch_release.py

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
from os import environ as env
2+
import requests
3+
import time
4+
import json
5+
6+
if 'RELEASE' in env and env['RELEASE']:
7+
release = env['RELEASE'].strip()
8+
else:
9+
release = "latest"
10+
11+
release_arg = "latest" if release == "latest" else f"tags/{release}"
12+
13+
print(f"release_arg set to {release_arg}")
14+
15+
release_url = f"https://api.github.com/repos/microsoft/git-credential-manager-core/releases/{release_arg}"
16+
17+
try:
18+
print(f"Fetching release {release_url}")
19+
r = requests.get(release_url)
20+
21+
# if at first you don't succeed...
22+
if r.status_code != 200:
23+
print(f"Trying again, initial status {r.status_code}")
24+
time.sleep(2)
25+
r = requests.get(release_url)
26+
27+
print("Response:")
28+
print(json.dumps(r.json(), indent=4))
29+
30+
if r.status_code != 200:
31+
raise ValueError(f"Failed to fetch release info from {release_url}")
32+
33+
asset = [a for a in r.json()['assets'] if a['name'].endswith(".deb")][0]
34+
asset_url = asset['browser_download_url']
35+
asset_name = asset['name']
36+
37+
print(f"Found asset {asset_name}")
38+
print(f"Writing asset URL: {asset_url} to asset_url.txt")
39+
40+
with open('asset_name.txt', 'w') as f:
41+
f.write(asset_name)
42+
43+
with open('asset_url.txt', 'w') as f:
44+
f.write(asset_url)
45+
46+
except RuntimeError as ex:
47+
print("Oh dear...")
48+
print(ex)
49+
exit(1)

.github/workflows/build-signed-deb.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
with:
5151
name: LinuxInstallers
5252

53-
- uses: Azure/login@v1.1
53+
- uses: azure/login@v1
5454
with:
5555
creds: ${{ secrets.AZURE_CREDENTIALS }}
5656

.github/workflows/release-apt-get.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: "release-apt-get"
2+
on:
3+
release:
4+
types: [released]
5+
6+
workflow_dispatch:
7+
inputs:
8+
release:
9+
description: 'Release Tag'
10+
required: true
11+
default: 'latest'
12+
13+
jobs:
14+
release:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: setup python
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: 3.8
21+
22+
- uses: actions/checkout@v2
23+
24+
- uses: azure/login@v1
25+
with:
26+
creds: ${{ secrets.AZURE_CREDENTIALS }}
27+
28+
- name: 'Download Repo Client'
29+
env:
30+
AZ_SUB: ${{ secrets.AZURE_SUBSCRIPTION }}
31+
run: |
32+
az storage blob download --subscription "$AZ_SUB" --account-name gitcitoolstore -c tools -n azure-repoapi-client_2.0.1_amd64.deb -f repoclient.deb --auth-mode login
33+
34+
- name: "Install Repo Client"
35+
env:
36+
APT_REPO_ID: ${{ secrets.APT_REPO_ID }}
37+
AZURE_AAD_ID: ${{ secrets.AZURE_AAD_ID }}
38+
AAD_CLIENT_SECRET: ${{ secrets.AAD_CLIENT_SECRET }}
39+
run: |
40+
sudo apt-get install python3-adal --yes
41+
sudo dpkg -i repoclient.deb
42+
python .github/configure_repoclient.py
43+
rm repoclient.deb
44+
45+
- name: "Publish to apt feed"
46+
env:
47+
RELEASE: ${{ github.event.inputs.release }}
48+
run: |
49+
pip install requests
50+
python .github/fetch_release.py
51+
wget "$(cat asset_url.txt)"
52+
repoclient -v v3 -c config.json package add --check --wait 300 "$(cat asset_name.txt)"

Directory.Build.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<ItemGroup>
2424
<!-- All projects should use Nerdbank.GitVersioning for consistent version numbers -->
2525
<PackageReference Include="Nerdbank.GitVersioning">
26-
<Version>3.2.7-beta</Version>
26+
<Version>3.3.37</Version>
2727
<PrivateAssets>all</PrivateAssets>
2828
</PackageReference>
2929
</ItemGroup>

README.md

+18-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ To install, run the following:
5151

5252
```shell
5353
brew tap microsoft/git
54-
brew cask install git-credential-manager-core
54+
brew install --cask git-credential-manager-core
5555
```
5656

5757
After installing you can stay up-to-date with new releases by running:
@@ -114,7 +114,23 @@ git-credential-manager-core configure
114114

115115
### Windows
116116

117-
You can download the [latest installer](https://github.com/microsoft/Git-Credential-Manager-Core/releases/latest) for Windows. To install, double-click the installation package and follow the instructions presented.
117+
You can download the [latest installer](https://github.com/microsoft/Git-Credential-Manager-Core/releases/latest) for Windows to install GCM Core standalone.
118+
119+
**:warning: Important :warning:**
120+
121+
Installing GCM Core as a standalone package on Windows will forcably override the version of GCM Core that is bundled with Git for Windows, **even if the version bundled with Git for Windows is a later version**.
122+
123+
There are two flavors of standalone installation on Windows:
124+
125+
- User (preferred) (`gcmcoreuser-win*`):
126+
127+
Does not require administrator rights. Will install only for the current user and updates only the current user's Git configuration.
128+
129+
- System (`gcmcore-win*`):
130+
131+
Requires administrator rights. Will install for all users on the system and update the system-wide Git configuration.
132+
133+
To install, double-click the desired installation package and follow the instructions presented.
118134

119135
#### Git Credential Manager for Windows
120136

docs/faq.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,18 @@ Yes. Usage of Git Credential Manager for Mac and Linux (Java GCM) should be repl
4747

4848
### Q: I want to use SSH
4949

50-
GCM Core is for HTTPS only. To use SSH please follow the below links:
50+
GCM Core is only useful for HTTP(S)-based remotes. Git supports SSH out-of-the box so you shouldn't need to install anything else.
51+
52+
To use SSH please follow the below links:
5153

5254
- [Azure DevOps](https://docs.microsoft.com/en-us/azure/devops/repos/git/use-ssh-keys-to-authenticate?view=azure-devops)
5355
- [GitHub](https://help.github.com/en/articles/connecting-to-github-with-ssh)
5456
- [Bitbucket](https://confluence.atlassian.com/bitbucket/ssh-keys-935365775.html)
5557

58+
### Q: Are HTTP(S) remotes preferred over SSH?
59+
60+
No, neither are "preferred". SSH isn't going away, and is supported "natively" in Git.
61+
5662
### Q: Why did you not just port the existing GCM Windows codebase from .NET Framework to .NET Core?
5763

5864
GCM Windows was not designed with a cross-platform architecture.

nuget.config

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<clear />
5+
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
6+
</packageSources>
7+
</configuration>

src/osx/Installer.Mac/scripts/postinstall

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ then
2727
fi
2828

2929
# Create symlink to GCM in /usr/local/bin
30+
mkdir -p /usr/local/bin
3031
/bin/ln -Fs "$INSTALL_DESTINATION/git-credential-manager-core" /usr/local/bin/git-credential-manager-core
3132

3233
# Configure GCM for the current user

src/shared/Atlassian.Bitbucket/BitbucketAuthentication.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public async Task<ICredential> GetBasicCredentialsAsync(Uri targetUri, string us
5050
var cmdArgs = new StringBuilder("userpass");
5151
if (!string.IsNullOrWhiteSpace(userName))
5252
{
53-
cmdArgs.AppendFormat(" --username {0}", userName);
53+
cmdArgs.AppendFormat(" --username {0}", QuoteCmdArg(userName));
5454
}
5555

5656
IDictionary<string, string> output = await InvokeHelperAsync(helperPath, cmdArgs.ToString());

0 commit comments

Comments
 (0)