-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (54 loc) · 2.2 KB
/
pull_request_builds.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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/orta/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@v1
- uses: actions/setup-node@v1
with:
node-version: "10.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 "Building TS Monaco $SEMVER_NUMBER"
node ./publish-monaco-ts.js $ZIP_FILE $SEMVER_NUMBER
echo "Building Monaco Editor with the new TS Monaco"
node ./publish-monaco-editor.js $SEMVER_NUMBER
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