From 531c3ce97def89ada92f5ec54404e62d15855e69 Mon Sep 17 00:00:00 2001 From: "Andrew Petrochuk (from Dev Box)" Date: Wed, 10 Jul 2024 19:06:44 -0700 Subject: [PATCH] Removed authenticated feeds --- .github/CODEOWNERS | 8 ++++++++ .github/workflows/Publish.yml | 2 -- .github/workflows/PullRequest.yml | 2 -- README.md | 13 ++++--------- gulp/lib/nugetInstall.mjs | 9 --------- gulp/restore.mjs | 1 - nuget.json | 20 ++------------------ 7 files changed, 14 insertions(+), 41 deletions(-) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..d9fe9881 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,8 @@ +# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners +# These owners will be the default owners for everything in +# the repo. Unless a later match takes precedence, +# @global-owner1 and @global-owner2 will be requested for +# review when someone opens a pull request. + +* @microsoft/powerapps-isv-tools-contrib @microsoft/powerplatform-isv-tools-admin +/.github/CODEOWNERS @microsoft/powerplatform-isv-tools-admin diff --git a/.github/workflows/Publish.yml b/.github/workflows/Publish.yml index 5478d393..2d8b9391 100644 --- a/.github/workflows/Publish.yml +++ b/.github/workflows/Publish.yml @@ -37,8 +37,6 @@ jobs: npm ci npm run set-version npm run dist - env: - AZ_DevOps_Read_PAT: ${{ secrets.AZ_DevOps_Read_PAT }} - name: Publish run: | diff --git a/.github/workflows/PullRequest.yml b/.github/workflows/PullRequest.yml index f51a2375..ae116eef 100644 --- a/.github/workflows/PullRequest.yml +++ b/.github/workflows/PullRequest.yml @@ -37,5 +37,3 @@ jobs: npm i -g npm@8.19.4 npm ci npm run ci - env: - AZ_DevOps_Read_PAT: ${{ secrets.AZ_DevOps_Read_PAT }} diff --git a/README.md b/README.md index eca7a78e..f143ce43 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Project +# Power Platform CLI Wrapper -This repo acts as the intermediate layer between different hosts (Power Platform Build Tools, GitHub Actions) and PAC CLI. +This repo contains the intermediate layer between [Power Platform Build Tools](https://github.com/microsoft/powerplatform-build-tools), [GitHub Actions](https://github.com/microsoft/powerplatform-actions) and [PAC CLI](https://aka.ms/PowerPlatformCLI). Cli-Wrapper by itself doesn't call a specific version of PAC CLI, it lets the individual hosts decide which version of PAC CLI to be used. Although, it is recommended that all hosts use the latest version of PAC CLI. @@ -33,7 +33,7 @@ Any use of third-party trademarks or logos are subject to those third-party's po Windows, macOS or Linux: -- [Node.js LTS (currently v12)](https://nodejs.org/en/download/) +- [Node.js (LTS)](https://nodejs.org/en/download/) - gulp CLI: ```npm install -g gulp-cli``` - [git](https://git-scm.com/downloads) - [VS Code](https://code.visualstudio.com/Download) or your different favorite editor @@ -43,12 +43,6 @@ Windows, macOS or Linux: - [GitLens (eamodio.gitlens)](https://github.com/eamodio/vscode-gitlens) - [markdownlint (davidanson.vscode-markdownlint)](https://github.com/DavidAnson/vscode-markdownlint) - [Mocha sidebar (maty.vscode-mocha-sidebar)](https://github.com/maty21/mocha-sidebar) -- TEMPORARY: - - Create a PAT for the Azure DevOps org ```msazure``` with scope: package(read) and add it as local environment variable. - ```Powershell - [Environment]::SetEnvironmentVariable('AZ_DevOps_Read_PAT', '', [EnvironmentVariableTarget]::User) - ``` - - Create a PAT in GitHub to read packages, and enable SSO for the microsoft organization. Then run 'npm login --scope=@microsoft --registry=https://npm.pkg.github.com' and provide the PAT as password. This will only be needed until this repo is made public. If developing on Linux or macOS, you will also need to install `git-lfs`. (It is prepackaged with the Git installer for Windows.) Follow the [instructions here](https://docs.github.com/en/github/managing-large-files/installing-git-large-file-storage) for your environment. @@ -60,6 +54,7 @@ Clone, restore modules, build and run: git clone https://github.com/microsoft/powerplatform-cli-wrapper.git cd powerplatform-cli-wrapper npm install +npm install -g gulp-cli gulp ci ``` diff --git a/gulp/lib/nugetInstall.mjs b/gulp/lib/nugetInstall.mjs index 076dafa4..356b7a9e 100644 --- a/gulp/lib/nugetInstall.mjs +++ b/gulp/lib/nugetInstall.mjs @@ -12,7 +12,6 @@ export default async function nugetInstall(feed, pkg) { const packageName = pkg.name.toLowerCase(); const version = pkg.version.toLowerCase(); const packagePath = `${packageName}/${version}/${packageName}.${version}.nupkg`; - const feedPAT = argv.feedPAT || process.env['AZ_DevOps_Read_PAT']; const nupkgUrl = new URL(packagePath, feed.url); const reqInit = { @@ -22,14 +21,6 @@ export default async function nugetInstall(feed, pkg) { }, redirect: "manual", }; - if (feed.authenticated) { - if (!feedPAT) { - throw new Error(`nuget feed ${feed.name} requires authN but neither '--feedPAT' argument nor env var '${feed.patEnvironmentVariable}' was defined!`); - } - reqInit.headers['Authorization'] = `Basic ${Buffer.from( - 'PAT:' + feedPAT - ).toString('base64')}`; - } info(`Downloading package: ${nupkgUrl}...`); let res = await fetch(nupkgUrl, reqInit); diff --git a/gulp/restore.mjs b/gulp/restore.mjs index c942edbd..2e97e004 100644 --- a/gulp/restore.mjs +++ b/gulp/restore.mjs @@ -7,7 +7,6 @@ const nugetFeeds = require("../nuget.json").feeds; // https://docs.microsoft.com/en-us/nuget/api/package-base-address-resource -// https://dev.azure.com/msazure/One/_packaging?_a=feed&feed=CAP_ISVExp_Tools_Daily export default gulp.series( ...nugetFeeds diff --git a/nuget.json b/nuget.json index fd02f3df..fe0a6121 100644 --- a/nuget.json +++ b/nuget.json @@ -7,32 +7,16 @@ "packages": [ { "name": "Microsoft.PowerApps.CLI", - "version": "1.32.8", + "version": "1.33.5", "internalName": "pac" }, { "name": "Microsoft.PowerApps.CLI.Core.linux-x64", - "version": "1.32.8", + "version": "1.33.5", "internalName": "pac_linux", "chmod": "tools/pac" } ] - }, - { - "name": "CAP_ISVExp_Tools_Stable", - "url": "https://pkgs.dev.azure.com/msazure/_packaging/b0441cf8-0bc8-4fad-b126-841a6184e784/nuget/v3/flat2/", - "authenticated": true, - "patEnvironmentVariable": "AZ_DevOps_Read_PAT", - "packages": [ - ] - }, - { - "name": "CAP_ISVExp_Tools_Daily", - "url": "https://pkgs.dev.azure.com/msazure/_packaging/d3fb5788-d047-47f9-9aba-76890f5cecf0/nuget/v3/flat2/", - "authenticated": true, - "patEnvironmentVariable": "AZ_DevOps_Read_PAT", - "packages": [ - ] } ] }