Skip to content

Commit

Permalink
Pass auth-mode login, I guess
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebailey committed Apr 10, 2024
1 parent d62c107 commit 51a6b17
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ jobs:
# Lets us use one-liner JSON manipulations on package.jsons
- run: "npm install -g json"

# For Azure uploads
- name: 'Az CLI login'
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Setup Monaco Editor
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: node ./publish-monaco-editor.js next

- name: 'Az CLI login'
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Upload to Azure
env:
AZURE_STORAGE_ACCOUNT: ${{ secrets.AZURE_STORAGE_ACCOUNT }}
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/pull_request_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@ jobs:
# Lets us use one-liner JSON manipulations on package.jsons
- run: "npm install -g json"

# For Azure uploads
- name: 'Az CLI login'
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Publish PR Build
env:
Expand Down Expand Up @@ -74,6 +67,14 @@ jobs:
echo "Commenting back on the PR"
node pulls/comment-on-release.js $PULL_REQUEST_NUMBER $SEMVER_NUMBER
- name: 'Az CLI login'
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}


- name: Upload to Azure
env:
AZURE_STORAGE_ACCOUNT: ${{ secrets.AZURE_STORAGE_ACCOUNT }}
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/ship_tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,19 @@ jobs:
# Lets us use one-liner JSON manipulations on package.jsons
- run: "npm install -g json"

# For Azure uploads
- name: 'Az CLI login'
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Setup Monaco Editor
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
FULL_TAG_REF: ${{ github.ref }}
run: "node ./publish-monaco-editor.js $(echo $FULL_TAG_REF | cut -d/ -f3)"

- name: 'Az CLI login'
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Upload to Azure
env:
AZURE_STORAGE_ACCOUNT: ${{ secrets.AZURE_STORAGE_ACCOUNT }}
Expand Down
8 changes: 4 additions & 4 deletions upload-assets-to-blob-storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,24 @@ function main() {
exec(`cp -r monaco-editor/node_modules/typescript releases/${optionalTag}/typescript`);
}

exec(`az storage blob upload-batch -s releases/ -d cdn --overwrite`);
exec(`az storage blob upload-batch --auth-mode login -s releases/ -d cdn --overwrite`);

step("Updating an index");
// Make sure we have some kind of index
const isPreRelease = safeTypeScriptPackage.includes("-");
const filename = isPreRelease ? "pre-releases.json" : "releases.json";

exec(`az storage blob download -c indexes -n ${filename} -f ${filename}`);
exec(`az storage blob download --auth-mode login -c indexes -n ${filename} -f ${filename}`);
exec(`json -I -f ${filename} -e "this.versions = Array.from(new Set([...this.versions, '${safeTypeScriptPackage}'])).sort()"`);
exec.continueOnError(`az storage blob upload -f ${filename} -c indexes -n ${filename} --overwrite`);
exec.continueOnError(`az storage blob upload --auth-mode login -f ${filename} -c indexes -n ${filename} --overwrite`);

// Update the next.json to be the latest _known_ nightly build of TS
if (isPreRelease) {
const existingReleases = JSON.parse(readFileSync(filename, "utf8")).versions;
const devReleases = existingReleases.filter(f => f.includes("-dev"));
const latest = devReleases.pop();
writeFileSync("releases/next.json", JSON.stringify({ version: latest }));
exec.continueOnError(`az storage blob upload -f "releases/next.json" -c indexes -n "next.json" --overwrite`);
exec.continueOnError(`az storage blob upload --auth-mode login -f "releases/next.json" -c indexes -n "next.json" --overwrite`);
}


Expand Down

0 comments on commit 51a6b17

Please sign in to comment.