Skip to content
name: Build a version of TypeScript on request
on: repository_dispatch
# This workflow is triggered from an API call where XXX is your token
# and YYY is the PR that it should look at.
# curl https://api.github.com/repos/microsoft/typescript-make-monaco-builds/dispatches \
# -XPOST \
# -H 'Content-Type: application/json' \
# -H 'Accept: application/vnd.github.everest-preview+json' \
# -H "Authorization: token XXX" \
# --data-binary '{ "event_type": "YYY" }'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16.x"
registry-url: "https://registry.npmjs.org"
# Lets us use one-liner JSON manipulations on package.jsons
- run: "npm install -g json"
# For Azure uploads
- run: curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
- name: Publish PR Build
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
run: |
yarn install
PULL_REQUEST_NUMBER=$(json -f $GITHUB_EVENT_PATH action)
echo "Publishing Monaco based on $PULL_REQUEST_NUMBER"
ZIP_FILE=$(node pulls/echo-typescript-url.js $PULL_REQUEST_NUMBER)
echo "Using zip file from:"
echo $ZIP_FILE
SEMVER_NUMBER=$(node pulls/echo-release-version.js $PULL_REQUEST_NUMBER)
echo "Re-publishing TypeScript tarball to npm"
node ./pulls/republish-typescript-tarball.js $ZIP_FILE $SEMVER_NUMBER
echo "Building TS Monaco $SEMVER_NUMBER"
echo "Building Monaco Editor with the new TS Monaco"
node ./publish-monaco-editor.js $SEMVER_NUMBER @typescript-deploys/pr-build
echo ""
echo ""
echo ""
echo "https://www.typescriptlang.org/play/?ts=$SEMVER_NUMBER"
echo ""
echo ""
echo ""
echo "Commenting back on the PR"
node pulls/comment-on-release.js $PULL_REQUEST_NUMBER $SEMVER_NUMBER
- name: Upload to Azure
env:
AZURE_STORAGE_ACCOUNT: ${{ secrets.AZURE_STORAGE_ACCOUNT }}
AZURE_STORAGE_KEY: ${{ secrets.AZURE_STORAGE_KEY }}
run: node ./upload-assets-to-blob-storage.js
# - name: Send a message to Microsoft Teams
# if: ${{ failure() }}
# uses: aliencube/microsoft-teams-actions@v0.8.0
# with:
# webhook_uri: ${{ secrets.TEAMS_WEB_BOT_INCOMING_URL }}
# title: "PR Playground Build failed for ${{ github.event.action }}"
# summary: Could not build the site for production
# text: Could not build the site for production
# actions: '[{ "@type": "OpenUri", "name": "View Logs", "targets": [{ "os": "default", "uri": "https://github.com/microsoft/TypeScript-Make-Monaco-Builds/actions/runs/${{ github.run_id }}?check_suite_focus=true" }, { "@type": "OpenUri", "name": "Troubleshooting ", "targets": [{ "os": "default", "uri": "https://github.com/microsoft/TypeScript-Make-Monaco-Builds#troubleshooting" }] }] }]'