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

Update microsoft/git to v2.35.0(-rc1) #15

Closed
wants to merge 246 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
246 commits
Select commit Hold shift + click to select a range
75cb426
reset --stdin: trim carriage return from the paths
Apr 5, 2017
8b0091e
gvfs: start by adding the -gvfs suffix to the version
sanoursa Jan 24, 2017
0a9de16
gvfs: ensure that the version is based on a GVFS tag
dscho Apr 4, 2017
fc1301b
gvfs: add a GVFS-specific header file
Jan 24, 2017
3353672
gvfs: add the core.gvfs config setting
Jan 24, 2017
4672a7f
gvfs: add the feature to skip writing the index' SHA-1
Jan 24, 2017
e004a70
gvfs: add the feature that blobs may be missing
Jan 24, 2017
0d0a610
gvfs: prevent files to be deleted outside the sparse checkout
May 18, 2016
d6b4c3d
gvfs: optionally skip reachability checks/upload pack during fetch
May 30, 2016
5ab6777
gvfs: ensure all filters and EOL conversions are blocked
Jun 15, 2016
0c16670
Add a new run_hook_strvec() function
dscho Nov 30, 2016
fb0da6e
gvfs: allow "virtualizing" objects
Jan 10, 2017
2fc7c7a
Add workflow for apt-get release
dscho Jun 25, 2021
eecfa92
sequencer: avoid progress when stderr is redirected
derrickstolee Sep 23, 2021
3f18b3f
Hydrate missing loose objects in check_and_freshen()
Mar 15, 2017
942b0ec
Add support for read-object as a background process to retrieve missi…
Jul 18, 2017
7e9e341
sha1_file: when writing objects, skip the read_object_hook
dscho Sep 8, 2017
2703340
gvfs: add global command pre and post hook procs
May 24, 2016
bc4bff0
t0400: verify that the hook is called correctly from a subdirectory
dscho Mar 16, 2017
eaa98fa
Pass PID of git process to hooks.
alepauly Apr 10, 2017
1a7b5b4
pre-command: always respect core.hooksPath
dscho Aug 7, 2017
b20e7f6
sparse-checkout: update files with a modify/delete conflict
Feb 22, 2017
93032d0
sparse-checkout: avoid writing entries with the skip-worktree bit
Mar 1, 2017
3f39a5d
Merge core VFS features
dscho Jun 11, 2018
774f582
status: add status serialization mechanism
jeffhostetler Aug 22, 2017
69331f9
Teach ahead-behind and serialized status to play nicely together
jamill Jan 10, 2018
3769d3f
status: serialize to path
jeffhostetler Feb 2, 2018
2011a1b
status: reject deserialize in V2 and conflicts
jeffhostetler Feb 7, 2018
a32e5ae
status: fix rename reporting when using serialization cache
jeffhostetler Jul 25, 2018
8713873
serialize-status: serialize global and repo-local exclude file metadata
jeffhostetler Jul 20, 2018
922c13b
status: deserialization wait
jeffhostetler Jul 25, 2018
8c30acd
merge-recursive: avoid confusing logic in was_dirty()
dscho May 21, 2019
e8062bd
merge-recursive: add some defensive coding to was_dirty()
dscho May 21, 2019
0ae50a1
Fix reset when using the sparse-checkout feature.
Mar 15, 2017
46dc7a1
merge-recursive: teach was_dirty() about the virtualfilesystem
dscho May 21, 2019
184c816
Do not remove files outside the sparse-checkout
Apr 5, 2017
f0eb522
Add virtual file system settings and hook proc
benpeart Jan 11, 2018
13bb028
status: deserialize with -uno does not print correct hint
jeffhostetler Jun 25, 2019
7352be7
gvfs: refactor loading the core.gvfs config value
Apr 14, 2017
5acd68a
Update the virtualfilesystem support
benpeart Jun 7, 2018
6d16240
wt-status-deserialize: fix crash when -v is used
jeffhostetler Apr 10, 2020
071b1a9
send-pack: do not check for sha1 file when GVFS_MISSING_OK set
Nov 16, 2018
697e05f
virtualfilesystem: don't run the virtual file system hook if the inde…
benpeart Aug 1, 2018
018271d
fsmonitor: check CE_FSMONITOR_VALID in ce_uptodate
kewillford Nov 21, 2019
8899d2e
cache-tree: remove use of strbuf_addf in update_one
Jul 3, 2017
b4390d9
virtualfilesystem: fix bug with symlinks being ignored
benpeart Sep 25, 2018
a42be05
fsmonitor: add script for debugging and update script for tests
kewillford Nov 21, 2019
454af2d
gvfs: block unsupported commands when running in a GVFS repo
benpeart Dec 6, 2018
c03b6a8
virtualfilesystem: check if directory is included
Oct 9, 2018
a47194d
status: disable deserialize when verbose output requested.
jeffhostetler Apr 11, 2020
1644d86
gvfs: allow overriding core.gvfs
derrickstolee Apr 15, 2020
a91355c
vfs: fix case where directories not handled correctly
jamill Nov 20, 2018
b93a123
t7524: add test for verbose status deserialzation
jeffhostetler Apr 11, 2020
d7e8a89
BRANCHES.md: Add explanation of branches and using forks
Jul 27, 2018
3fbd8b4
backwards-compatibility: support the post-indexchanged hook
dscho May 28, 2019
9f5f29a
deserialize-status: silently fallback if we cannot read cache file
jeffhostetler May 13, 2020
20d01a4
credential: set trace2_child_class for credential manager children
jeffhostetler Oct 3, 2019
ab1c922
sub-process: do not borrow cmd pointer from caller
jeffhostetler Sep 18, 2019
3d9541a
sub-process: add subprocess_start_argv()
jeffhostetler Sep 18, 2019
6cea74f
sha1-file: add function to update existing loose object cache
jeffhostetler Sep 24, 2019
9c7ccf7
packfile: add install_packed_git_and_mru()
jeffhostetler Sep 25, 2019
882799f
gvfs:trace2:data: add trace2 tracing around read_object_process
jeffhostetler Sep 26, 2018
20c4319
index-pack: avoid immediate object fetch while parsing packfile
jeffhostetler Sep 24, 2019
df29d22
gvfs:trace2:data: status deserialization information
jeffhostetler Sep 26, 2018
e4227e4
gvfs-helper: create tool to fetch objects using the GVFS Protocol
jeffhostetler Aug 13, 2019
7a7cdfc
gvfs:trace2:data: status serialization
jeffhostetler Jan 7, 2019
cb55536
gvfs-helper: fix race condition when creating loose object dirs
derrickstolee Oct 4, 2019
11f2e5b
gvfs:trace2:data: add vfs stats
jeffhostetler Nov 19, 2018
5106141
sha1-file: create shared-cache directory if it doesn't exist
jeffhostetler Oct 7, 2019
ac1e65b
trace2: refactor setting process starting time
jeffhostetler Apr 15, 2019
73af904
gvfs-helper: better handling of network errors
jeffhostetler Oct 8, 2019
dc6a112
trace2:gvfs:experiment: clear_ce_flags_1
jeffhostetler Apr 30, 2019
99e5a42
gvfs-helper-client: properly update loose cache with fetched OID
jeffhostetler Oct 8, 2019
8997829
trace2:gvfs:experiment: report_tracking
jeffhostetler Apr 30, 2019
fc3b911
gvfs-helper: V2 robust retry and throttling
jeffhostetler Oct 10, 2019
dea2bc9
trace2:gvfs:experiment: read_cache: annotate thread usage in read-cache
jeffhostetler Jun 14, 2019
e4e2642
gvfs-helper: expose gvfs/objects GET and POST semantics
jeffhostetler Oct 21, 2019
5360489
trace2:gvfs:experiment: read-cache: time read/write of cache-tree ext…
jeffhostetler Jul 9, 2019
f95b09d
gvfs-helper: dramatically reduce progress noise
derrickstolee Oct 24, 2019
8653d00
gvfs-helper: add prefetch support
jeffhostetler Nov 11, 2019
ea87c13
cache-tree: use `r` instead of `the_repository` in Trace2
jeffhostetler Jun 3, 2019
bc18ba4
gvfs-helper-client.h: define struct object_id
derrickstolee Nov 4, 2019
698090b
gvfs-helper: add prefetch .keep file for last packfile
jeffhostetler Nov 26, 2019
4970e72
trace2:gvfs:experiment: add region to apply_virtualfilesystem()
jeffhostetler Jul 16, 2019
6237ad3
gvfs-helper: handle pack-file after single POST request
derrickstolee Nov 11, 2019
13e5f66
gvfs-helper: do one read in my_copy_fd_len_tail()
derrickstolee Dec 16, 2019
1905853
trace2:gvfs:experiment: add region around unpack_trees()
jeffhostetler Jul 16, 2019
44ad9a3
test-gvfs-prococol, t5799: tests for gvfs-helper
jeffhostetler Oct 25, 2019
c00e95c
gvfs-helper: move content-type warning for prefetch packs
derrickstolee Dec 16, 2019
f82e534
trace2:gvfs:experiment: add region to cache_tree_fully_valid()
jeffhostetler Jul 16, 2019
4921f88
gvfs-helper: move result-list construction into install functions
jeffhostetler Nov 13, 2019
96eba07
fetch: use gvfs-helper prefetch under config
derrickstolee Dec 17, 2019
56128dc
trace2:gvfs:experiment: add unpack_entry() counter to unpack_trees() …
jeffhostetler Jul 16, 2019
5b0ddd7
t5799: add support for POST to return either a loose object or packfile
jeffhostetler Nov 13, 2019
8cc9d30
gvfs-helper: better support for concurrent packfile fetches
jeffhostetler Dec 18, 2019
9097bf7
trace2:gvfs:experiment: increase default event depth for unpack-tree …
jeffhostetler Jul 25, 2019
5e73966
t5799: cleanup wc-l and grep-c lines
jeffhostetler Nov 13, 2019
47941c3
remote-curl: do not call fetch-pack when using gvfs-helper
derrickstolee Feb 3, 2020
cf7a903
update-microsoft-git: create barebones builtin
derrickstolee Apr 29, 2021
6cd8c8e
trace2:gvfs:experiment: add data for check_updates() in unpack_trees()
jeffhostetler Jul 25, 2019
2789e5b
gvfs-helper: verify loose objects after write
derrickstolee Sep 18, 2020
bce3f66
fetch: reprepare packs before checking connectivity
derrickstolee Mar 12, 2020
84a1c64
homebrew: add GitHub workflow to release Cask
mjcheetham Jul 24, 2020
0162b53
update-microsoft-git: Windows implementation
derrickstolee Apr 29, 2021
f4cfb25
Merge advanced VFS-specific features
dscho Jun 11, 2018
7741ef9
Trace2:gvfs:experiment: capture more 'tracking' details
jeffhostetler Jul 26, 2019
494e2dc
t7599: create corrupt blob test
jeffhostetler Sep 18, 2020
ca10523
gvfs-helper: retry when creating temp files
derrickstolee Dec 26, 2019
8c886b3
upload-pack: fix race condition in error messages
derrickstolee Aug 27, 2019
157f0d1
maintenance: care about gvfs.sharedCache config
derrickstolee Dec 15, 2020
6b5e2b3
unpack-trees:virtualfilesystem: Improve efficiency of clear_ce_flags
neerajsi-msft2 Feb 6, 2021
17215f4
Adding winget workflows
Apr 29, 2021
15fb364
update-microsoft-git: use brew on macOS
derrickstolee Apr 29, 2021
fc3cf93
Adding readme for microsoft/git
May 4, 2021
6dc4395
Merge virtualfilesystem hook
dscho Jun 11, 2018
51c9e51
Merge updates to serialized status
dscho Jun 11, 2018
828670e
Merge trace2 experimental regions
jeffhostetler Apr 23, 2019
e1ecadc
Merge first wave of gvfs-helper feature
jeffhostetler Nov 14, 2019
10886a4
Merge gvfs-helper prefetch feature
derrickstolee Dec 17, 2019
d0642cd
Merge upstreamable patches
dscho Oct 18, 2018
f4ec52d
Merge pull request #301: Update 'git maintenance' to match upstream
derrickstolee Dec 15, 2020
f0767e3
Merge pull request #315: unpack-trees:virtualfilesystem: Improve effi…
derrickstolee Feb 16, 2021
c12ca4b
Implement `scalar diagnose`
dscho Apr 16, 2021
e1ea570
Merge pull request #328: Adding winget workflow
derrickstolee Apr 30, 2021
6ef8ee8
scalar diagnose: include disk space information
dscho Apr 22, 2021
320840c
Merge pull request #329: Add `git update-microsoft-git`
derrickstolee Apr 30, 2021
3cbd3cd
scalar: teach `diagnose` to gather packfile info
mjcheetham May 19, 2021
8a386d9
Merge pull request #333: update microsoft/git README
derrickstolee May 17, 2021
9b32952
scalar: teach `diagnose` to gather loose objs info
mjcheetham May 19, 2021
741e428
ci: run Scalar's Functional Tests
dscho Jun 8, 2021
d57dbee
t1092: mark passing test as success
derrickstolee May 28, 2021
7c6cb18
scalar diagnose: show a spinner while staging content
dscho Apr 28, 2021
1c523a1
scalar: accept -C and -c options before the subcommand
dscho Apr 29, 2021
1f8af05
Merge pull request #371 from dscho/run-scalar-functional-tests-and-fi…
dscho Jun 9, 2021
77025f7
Merge branch 'scalar-diagnose'
dscho May 3, 2021
08f6680
Merge branch 'scalar-c-and-C'
dscho May 3, 2021
d9083dc
scalar: enable built-in FSMonitor on `register`
mjcheetham May 19, 2021
64226ab
git_config_set_multivar_in_file_gently(): add a lock timeout
dscho May 18, 2021
b4bf95d
git help: special-case `scalar`
dscho May 4, 2021
3dc8ac1
scalar unregister: stop FSMonitor daemon
dscho Apr 22, 2021
8d0689f
scalar: set the config write-lock timeout to 150ms
dscho May 18, 2021
7d09de6
scalar: implement the `help` subcommand
dscho May 18, 2021
ed193a4
Optionally include `scalar` when building/testing Git
dscho May 4, 2021
65abf43
scalar: implement a minimal JSON parser
dscho Apr 26, 2021
d335512
NOT-TO-UPSTREAM: ci: build `scalar.exe`, too
dscho Apr 14, 2021
33a3f27
scalar clone: support GVFS-enabled remote repositories
dscho Apr 16, 2021
0e1b2f4
ci(windows): also run `scalar` tests
dscho Apr 14, 2021
79af738
test-gvfs-protocol: also serve smart protocol
dscho Apr 16, 2021
134988d
gvfs-helper: add the `endpoint` command
dscho Apr 26, 2021
fa588c8
dir_inside_of(): handle directory separators correctly
dscho May 14, 2021
8297758
scalar: disable authentication in unattended mode
dscho May 6, 2021
4edd040
Merge branch 'scalar-and-builtin-fsmonitor'
dscho May 3, 2021
f36048b
Merge branch 'scalar-gentler-config-locking'
dscho May 19, 2021
dae699a
Merge branch 'include-scalar-in-build'
dscho May 4, 2021
9d0e6ab
Merge branch 'scalar-ci'
dscho May 3, 2021
ea5f9c0
scalar: do initialize `gvfs.sharedCache`
dscho May 3, 2021
6217f30
scalar diagnose: include shared cache info
dscho Jun 1, 2021
6eac9ab
scalar: only try GVFS protocol on https:// URLs
dscho Apr 28, 2021
e21224a
scalar: verify that we can use a GVFS-enabled repository
dscho Apr 16, 2021
f6444ca
scalar: add the `cache-server` command
dscho Apr 23, 2021
105420e
scalar: add a test toggle to skip accessing the vsts/info endpoint
dscho May 12, 2021
a5ceae3
Merge branch 'scalar-with-gvfs'
dscho May 3, 2021
722b668
scalar: add retry logic to run_git()
derrickstolee Jun 17, 2021
0a7b350
scalar: add docs from microsoft/scalar
derrickstolee Jun 16, 2021
38a66ef
Merge pull request #366 from dscho/features/scalar-2.32.0
dscho Jun 9, 2021
ee06f6a
scalar: only retry a full clone if not using GVFS protocol
derrickstolee Jun 17, 2021
10a4d09
release: create initial Windows installer build workflow
vdye Jul 16, 2021
2764931
scalar: document the remaining subcommands
dscho May 3, 2021
66f006d
release: add Mac OSX installer build
vdye Jul 16, 2021
dce70e8
Merge pull request #377: Update README to include Scalar CLI details
derrickstolee Jun 17, 2021
d8bfedb
release: build unsigned Ubuntu .deb package
vdye Jul 16, 2021
8ceb16e
gvfs: disable the built-in FSMonitor
dscho Jun 18, 2021
bd56c06
Merge pull request #378: Scalar: Fix some flaky tests with retry logi…
derrickstolee Jun 18, 2021
ae60ec7
release: add signing step for .deb package
vdye Jul 16, 2021
6935695
Merge pull request #379 from dscho/disable-fsmonitor-with-gvfs
dscho Jun 18, 2021
37e688d
release: create draft GitHub release with packages & installers
vdye Jul 16, 2021
35ddf1c
add/rm: allow adding sparse entries when virtual
derrickstolee Jun 29, 2021
25c37ec
Merge pull request #386 from ldennington/add-release-apt-get-workflow
Jun 28, 2021
06ac7b8
release: continue pestering until user upgrades
derrickstolee Oct 6, 2021
bf1c223
Merge pull request #392: add: allow adding sparse entries when virtual
derrickstolee Jul 1, 2021
e3f55e7
Merge pull request #399 from vdye/feature/build-installers
vdye Jul 29, 2021
9bbb68f
Makefile: disable cURL warnings on gvfs-helper.c
derrickstolee Aug 3, 2021
36e5de1
t7524: test no longer fails
derrickstolee Aug 22, 2021
7ff8f21
merge-ort: ignore skip-worktree bit with virtual filesystem
derrickstolee Aug 17, 2021
b6d69e0
repo-settings: enable sparse index by default
derrickstolee Jun 15, 2021
b229fd1
Merge pull request #410: Sparse Index: latest integrations
derrickstolee Aug 24, 2021
c1ba33c
Merge pull request #414: Make sparse index the default
derrickstolee Aug 26, 2021
49b09a8
sparse-index: create expand_to_pattern_list()
derrickstolee Sep 3, 2021
348d5f0
dir: add path_matches_cone_mode_pattern_list()
derrickstolee Sep 3, 2021
ae8667d
sparse-index: introduce partially-sparse indexes
derrickstolee Sep 3, 2021
0d366f7
cache-tree: implement cache_tree_find_path()
derrickstolee Sep 3, 2021
7f2293b
update-index (bugfix): `--cacheinfo` should block directories
vdye Sep 10, 2021
03220c0
sparse-index: partially expand directories
derrickstolee Sep 3, 2021
c9b77b7
update-index: add tests for sparse-checkout compatibility
vdye Sep 9, 2021
b655140
scalar: enable untracked cache unconditionally
derrickstolee Jun 21, 2021
fbfab6c
sparse-index: complete partial expansion
derrickstolee Sep 3, 2021
c2a4a29
checkout-index: expand sparse checkout compatibility tests
vdye Sep 9, 2021
9bcdf98
update-index: integrate with sparse index
vdye Sep 9, 2021
20be8c3
Use GIT_FORCE_UNTRACKED_CACHE in functional tests
derrickstolee Aug 27, 2021
15e41d3
sparse-checkout: integrate with sparse index
derrickstolee Sep 3, 2021
c8db219
read-tree: add performance test in p2000
vdye Sep 15, 2021
bb3a16b
checkout-index: add `--sparse` option
vdye Sep 10, 2021
d2f3aee
update-index: remove sparse index expansion for --cacheinfo
vdye Sep 9, 2021
923768e
dir: force untracked cache with core.untrackedCache
derrickstolee Aug 30, 2021
d4d6e64
Merge pull request #421: Sparse index: integrate with the `sparse-che…
derrickstolee Sep 7, 2021
d334c4d
read-tree: expand sparse checkout test coverage
vdye Sep 13, 2021
4575173
checkout-index: integrate with sparse index
vdye Sep 10, 2021
14f6d95
p2000: explicitly turn off sparse index
derrickstolee Sep 13, 2021
635af52
update-index: remove unnecessary index expansion in do_reupdate
vdye Sep 9, 2021
9f6497f
Merge pull request #415: scalar: enable untracked cache unconditionally
derrickstolee Sep 7, 2021
f8859b7
p2000: add performance test for `git stash`
vdye Sep 20, 2021
6798d61
status: bugfix directory diff in sparse index
vdye Sep 14, 2021
08f74e1
checkout-index: improve `ensure_full_index` scope in `checkout_all`
vdye Sep 10, 2021
53648b5
p2000: add new commands
derrickstolee Sep 13, 2021
2a08981
Merge pull request #423 from vdye/sparse-index/update-index
vdye Sep 13, 2021
dfc3d45
stash: integrate with sparse index
vdye Sep 16, 2021
84d5a7b
read-tree: integrate with sparse index
vdye Sep 14, 2021
0188bde
checkout-index: add performance test for `checkout-index --all`
vdye Sep 13, 2021
b4ead0e
Merge pull request #425: Sparse index: add more performance tests
derrickstolee Sep 13, 2021
10a1263
merge-recursive: add merge function arg to `merge_recursive_generic`
vdye Sep 16, 2021
3fc79d0
read-tree: narrow scope of index expansion for `--prefix`
vdye Sep 15, 2021
4e75680
Merge pull request #424 from vdye/sparse-index/checkout-index
vdye Sep 14, 2021
0b2674c
clean: integrate with sparse index
vdye Sep 22, 2021
b3bf5cc
stash: use merge-ort rather than merge-recursive
vdye Sep 16, 2021
0542873
Merge pull request #426 from vdye/sparse-index/read-tree
vdye Sep 20, 2021
c3b8e21
unpack-trees: expand conditions for sparse result index
vdye Sep 24, 2021
efc6ae6
stash: expand testing for `git stash -u`
vdye Sep 22, 2021
c347c78
Merge pull request #428 from vdye/sparse-index/stash
vdye Sep 21, 2021
68635c5
checkout-index: perform lazy index expansion for `--sparse`
vdye Sep 24, 2021
4832358
Merge pull request #430 from vdye/sparse-index/clean
vdye Sep 23, 2021
0ea9a32
stash: move sparse index test for `stash -u`
vdye Sep 24, 2021
653cdeb
Merge pull request #432: sequencer: avoid progress when stderr is red…
derrickstolee Sep 23, 2021
07f60c7
blame: enable and test the sparse index
ldennington Sep 17, 2021
2075e1d
Merge pull request #433 from vdye/remove-index-expansions
vdye Sep 24, 2021
74bc036
Merge pull request #431 from ldennington/sparse-index-blame
ldennington Sep 27, 2021
c64bc5c
sparse: add vfs-specific precautions
derrickstolee Oct 31, 2021
c8b1b36
Makefile: allow specifying GIT_BUILT_FROM_COMMIT
vdye Nov 30, 2021
6e5fb8b
t1092: add compatibility tests for 'git show'
derrickstolee Nov 29, 2021
8fceee2
maintenance: delete stale lock files
derrickstolee Nov 16, 2021
102c616
t0001: drop memory-leak check
derrickstolee Oct 31, 2021
c4ab686
dist: archive HEAD instead of HEAD^{tree}
vdye Dec 2, 2021
31c22bc
show: integrate with the sparse index
derrickstolee Nov 29, 2021
90dbe75
Merge pull request #468: maintenance: delete stale lock files, fix lo…
derrickstolee Nov 16, 2021
ec61b47
release: include GIT_BUILT_FROM_COMMIT in MacOS build
vdye Dec 2, 2021
c0b74e9
Merge pull request #470: Sparse Index: integrate with `git show`
derrickstolee Dec 6, 2021
db8c1bd
Merge pull request #472 from vdye/ms/macos-build-options
vdye Dec 6, 2021
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
117 changes: 117 additions & 0 deletions .github/scripts/sign-debian-packages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
import json
import os
import glob
import pprint
import subprocess
import sys

esrp_tool = os.path.join("esrp", "tools", "EsrpClient.exe")

AAD_ID = "38aa33bc-a7e7-4007-bfb2-e8b17f04aadc"
WORKSPACE = os.environ['GITHUB_WORKSPACE'].strip()
ARTIFACTS_DIR = os.environ['ARTIFACTS_DIR'].strip()

def main():
source_root_location = os.path.join(WORKSPACE, ARTIFACTS_DIR, "unsigned")
destination_location = os.path.join(WORKSPACE, ARTIFACTS_DIR)

files = glob.glob(os.path.join(source_root_location, "*.deb"))

print("Found files:")
pprint.pp(files)

if len(files) < 1 or not files[0].endswith(".deb"):
print("Error: cannot find .deb to sign")
exit(1)

file_to_sign = os.path.basename(files[0])

auth_json = {
"Version": "1.0.0",
"AuthenticationType": "AAD_CERT",
"TenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47",
"ClientId": AAD_ID,
"AuthCert": {
"SubjectName": f"CN={AAD_ID}.microsoft.com",
"StoreLocation": "LocalMachine",
"StoreName": "My",
},
"RequestSigningCert": {
"SubjectName": f"CN={AAD_ID}",
"StoreLocation": "LocalMachine",
"StoreName": "My",
}
}

input_json = {
"Version": "1.0.0",
"SignBatches": [
{
"SourceLocationType": "UNC",
"SourceRootDirectory": source_root_location,
"DestinationLocationType": "UNC",
"DestinationRootDirectory": destination_location,
"SignRequestFiles": [
{
"CustomerCorrelationId": "01A7F55F-6CDD-4123-B255-77E6F212CDAD",
"SourceLocation": file_to_sign,
"DestinationLocation": os.path.join("signed", file_to_sign),
}
],
"SigningInfo": {
"Operations": [
{
"KeyCode": "CP-450779-Pgp",
"OperationCode": "LinuxSign",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0",
}
]
}
}
]
}

policy_json = {
"Version": "1.0.0",
"Intent": "production release",
"ContentType": "Debian package",
}

configs = [
("auth.json", auth_json),
("input.json", input_json),
("policy.json", policy_json),
]

for filename, data in configs:
with open(filename, 'w') as fp:
json.dump(data, fp)

# Run ESRP Client
esrp_out = "esrp_out.json"
result = subprocess.run(
[esrp_tool, "sign",
"-a", "auth.json",
"-i", "input.json",
"-p", "policy.json",
"-o", esrp_out,
"-l", "Verbose"],
cwd=WORKSPACE)

if result.returncode != 0:
print("Failed to run ESRPClient.exe")
sys.exit(1)

if os.path.isfile(esrp_out):
print("ESRP output json:")
with open(esrp_out, 'r') as fp:
pprint.pp(json.load(fp))

signed_file = os.path.join(destination_location, "signed", file_to_sign)
if os.path.isfile(signed_file):
print(f"Success!\nSigned {signed_file}")

if __name__ == "__main__":
main()
Loading