From f703aea2a41df9bc73887df0968f51d463718e16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Sat, 18 Nov 2023 16:05:04 +0100 Subject: [PATCH 1/9] Add delete_all_packages.py to delete all packages from a repository --- delete_all_packages.py | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 delete_all_packages.py diff --git a/delete_all_packages.py b/delete_all_packages.py new file mode 100644 index 00000000000000..12d03105c1dd16 --- /dev/null +++ b/delete_all_packages.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python3 + +# This script allows you to mass delete all packages from a 'user' repository. +# This only deletes 30 packages at a time. Repeat it until everything is deleted. + +import requests + +# Replace these variables with a Personal access token from GitHub +your_token = 'ghp_' +user = 'user' + +def delete_packages(pat, user): + headers = { + 'Authorization': f'Bearer {pat}', + 'X-GitHub-Api-Version': '2022-11-28', + 'Accept': 'application/vnd.github+json' # Required header for package deletion API + } + + # Fetching package versions + response = requests.get(f'https://api.github.com/users/{user}/packages?package_type=nuget', headers=headers) + if response.status_code != 200: + print(f"Failed to fetch packages: {response.status_code}") + return + + print(response.json()) + + packages = response.json() + + # Deleting each package + for package in packages: + package_name = package.get('name') + delete_url = f'https://api.github.com/users/{user}/packages/nuget/{package_name}' + delete_response = requests.delete(delete_url, headers=headers) + if delete_response.status_code == 204: + print(f"Package {package_name} deleted successfully.") + else: + print(f"Failed to delete package {package_name}: {delete_response.status_code}") + +delete_packages(your_token, user) + From 3bd3ac5fd23389fd3cebe68d33caff334b8e5c2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Wed, 27 Dec 2023 19:55:52 +0100 Subject: [PATCH 2/9] use .netrc for storing credentials Co-authored-by: Jan Holthuis --- delete_all_packages.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/delete_all_packages.py b/delete_all_packages.py index 12d03105c1dd16..a4245592f91db3 100644 --- a/delete_all_packages.py +++ b/delete_all_packages.py @@ -5,9 +5,10 @@ import requests -# Replace these variables with a Personal access token from GitHub -your_token = 'ghp_' -user = 'user' +import netrc + +# Configure your GitHub user name and Personal Access Token (PAT) to the `.netrc` file. +user, _, your_token = netrc.netrc().authenticators("api.github.com") def delete_packages(pat, user): headers = { From 6e3c76d762fc232560b57ef82d8e7b7d09739a14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Wed, 27 Dec 2023 19:59:18 +0100 Subject: [PATCH 3/9] Require script to run as such Co-authored-by: Jan Holthuis --- delete_all_packages.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/delete_all_packages.py b/delete_all_packages.py index a4245592f91db3..b363cec8541eef 100644 --- a/delete_all_packages.py +++ b/delete_all_packages.py @@ -37,5 +37,6 @@ def delete_packages(pat, user): else: print(f"Failed to delete package {package_name}: {delete_response.status_code}") -delete_packages(your_token, user) +if __name__ == "__main__": + delete_packages(your_token, user) From 1e58f86c09cea8fb221734bbcec6389275a3cbdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Wed, 27 Dec 2023 19:59:45 +0100 Subject: [PATCH 4/9] Uprove error handling Co-authored-by: Jan Holthuis --- delete_all_packages.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/delete_all_packages.py b/delete_all_packages.py index b363cec8541eef..c7e1e1d60f609a 100644 --- a/delete_all_packages.py +++ b/delete_all_packages.py @@ -19,9 +19,7 @@ def delete_packages(pat, user): # Fetching package versions response = requests.get(f'https://api.github.com/users/{user}/packages?package_type=nuget', headers=headers) - if response.status_code != 200: - print(f"Failed to fetch packages: {response.status_code}") - return + response.raise_for_status() print(response.json()) From be3d9f85a4c5f394a1c16da232eef4e076b6e4df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Wed, 27 Dec 2023 20:03:09 +0100 Subject: [PATCH 5/9] move delete_all_packages.py into overlay folder --- delete_all_packages.py => overlay/scripts/delete_all_packages.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename delete_all_packages.py => overlay/scripts/delete_all_packages.py (100%) diff --git a/delete_all_packages.py b/overlay/scripts/delete_all_packages.py similarity index 100% rename from delete_all_packages.py rename to overlay/scripts/delete_all_packages.py From 7b7ea13bee345b5863ebcf7a0fbc63a6ef8f22cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Sun, 24 Dec 2023 13:06:59 +0100 Subject: [PATCH 6/9] Add Azure code signing for the Windows release DLLs --- .github/workflows/build.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a52bbb52a44218..e3becd86dfd4a3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -88,6 +88,25 @@ jobs: - name: Build packages run: ./vcpkg install --vcpkg-root=${{ matrix.vcpkg_path }} --clean-after-build --recurse --feature-flags="-compilertracking,manifests,registries,versions" --x-abi-tools-use-exact-versions working-directory: ${{ matrix.vcpkg_path }} + + - name: "[Windows] Sign release DLLs" + env: + AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} + if: runner.os == 'Windows' && env.AZURE_TENANT_ID + uses: azure/azure-code-signing-action@v0.2.22 + with: + azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }} + azure-client-id: ${{ secrets.AZURE_CLIENT_ID }} + azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }} + endpoint: https://weu.codesigning.azure.net/ + code-signing-account-name: mixxx + certificate-profile-name: mixxx + files-folder: ${{ matrix.vcpkg_path }}/installed/${{ matrix.vcpkg_triplet }}/bin + files-folder-filter: dll + file-digest: SHA256 + timestamp-rfc3161: http://timestamp.acs.microsoft.com + timestamp-digest: SHA256 + timeout: 600 - name: Upload GitHub Actions artifacts of build logs if: always() From addcb443c7e8a8e106ea5fd9c2e305feab01cc0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Wed, 27 Dec 2023 22:37:08 +0100 Subject: [PATCH 7/9] Add Azure code signing for the Windows Qt plugins --- .github/workflows/build.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e3becd86dfd4a3..3af5290fd26bc6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -107,6 +107,26 @@ jobs: timestamp-rfc3161: http://timestamp.acs.microsoft.com timestamp-digest: SHA256 timeout: 600 + + - name: "[Windows] Sign release plugins" + env: + AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} + if: runner.os == 'Windows' && env.AZURE_TENANT_ID + uses: azure/azure-code-signing-action@v0.2.22 + with: + azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }} + azure-client-id: ${{ secrets.AZURE_CLIENT_ID }} + azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }} + endpoint: https://weu.codesigning.azure.net/ + code-signing-account-name: mixxx + certificate-profile-name: mixxx + files-folder: ${{ matrix.vcpkg_path }}/installed/${{ matrix.vcpkg_triplet }}/Qt6/plugins + files-folder-filter: dll + files-folder-recurse: true + file-digest: SHA256 + timestamp-rfc3161: http://timestamp.acs.microsoft.com + timestamp-digest: SHA256 + timeout: 600 - name: Upload GitHub Actions artifacts of build logs if: always() From 5889ac54cc8532259e653068f9ff1c7e2aae28fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Thu, 28 Dec 2023 00:40:17 +0100 Subject: [PATCH 8/9] Add Azure code signing for the QML DLLs --- .github/workflows/build.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3af5290fd26bc6..9b836f0b8180c6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -127,6 +127,26 @@ jobs: timestamp-rfc3161: http://timestamp.acs.microsoft.com timestamp-digest: SHA256 timeout: 600 + + - name: "[Windows] Sign qml DLLs" + env: + AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} + if: runner.os == 'Windows' && env.AZURE_TENANT_ID + uses: azure/azure-code-signing-action@v0.2.22 + with: + azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }} + azure-client-id: ${{ secrets.AZURE_CLIENT_ID }} + azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }} + endpoint: https://weu.codesigning.azure.net/ + code-signing-account-name: mixxx + certificate-profile-name: mixxx + files-folder: ${{ matrix.vcpkg_path }}/installed/${{ matrix.vcpkg_triplet }}/Qt6/qml + files-folder-filter: dll + files-folder-recurse: true + file-digest: SHA256 + timestamp-rfc3161: http://timestamp.acs.microsoft.com + timestamp-digest: SHA256 + timeout: 600 - name: Upload GitHub Actions artifacts of build logs if: always() From 5d58718e04ee9196314dc77d7cf414f36be24b65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Thu, 28 Dec 2023 09:22:30 +0100 Subject: [PATCH 9/9] Adjust name of installed folder to vcpkg_installed --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9b836f0b8180c6..27aeba50a3dcf2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -101,7 +101,7 @@ jobs: endpoint: https://weu.codesigning.azure.net/ code-signing-account-name: mixxx certificate-profile-name: mixxx - files-folder: ${{ matrix.vcpkg_path }}/installed/${{ matrix.vcpkg_triplet }}/bin + files-folder: ${{ matrix.vcpkg_path }}/vcpkg_installed/${{ matrix.vcpkg_triplet }}/bin files-folder-filter: dll file-digest: SHA256 timestamp-rfc3161: http://timestamp.acs.microsoft.com @@ -120,7 +120,7 @@ jobs: endpoint: https://weu.codesigning.azure.net/ code-signing-account-name: mixxx certificate-profile-name: mixxx - files-folder: ${{ matrix.vcpkg_path }}/installed/${{ matrix.vcpkg_triplet }}/Qt6/plugins + files-folder: ${{ matrix.vcpkg_path }}/vcpkg_installed/${{ matrix.vcpkg_triplet }}/Qt6/plugins files-folder-filter: dll files-folder-recurse: true file-digest: SHA256 @@ -140,7 +140,7 @@ jobs: endpoint: https://weu.codesigning.azure.net/ code-signing-account-name: mixxx certificate-profile-name: mixxx - files-folder: ${{ matrix.vcpkg_path }}/installed/${{ matrix.vcpkg_triplet }}/Qt6/qml + files-folder: ${{ matrix.vcpkg_path }}/vcpkg_installed/${{ matrix.vcpkg_triplet }}/Qt6/qml files-folder-filter: dll files-folder-recurse: true file-digest: SHA256