-
-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (63 loc) · 2.34 KB
/
Copy pathupdate-monaco.yml
File metadata and controls
76 lines (63 loc) · 2.34 KB
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
70
71
72
73
74
75
76
name: Update Monaco Editor
on:
workflow_dispatch:
permissions:
contents: write
jobs:
update-monaco:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
- name: Update Monaco Editor
run: npm install --save-dev monaco-editor@latest
- name: Resolve Monaco Editor version
id: monaco
shell: bash
run: |
VERSION=$(node -p "require('./node_modules/monaco-editor/package.json').version")
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Set package version
run: npm version "${{ steps.monaco.outputs.version }}" --no-git-tag-version --allow-same-version
- name: Refresh install and lockfile
run: npm install
- name: Build package
run: npm run build
- name: Detect repository changes
id: changes
shell: bash
run: |
if [[ -n "$(git status --porcelain -- package.json package-lock.json esm min)" ]]; then
echo "has_changes=true" >> "$GITHUB_OUTPUT"
else
echo "has_changes=false" >> "$GITHUB_OUTPUT"
fi
- name: Commit, tag, and push changes
if: steps.changes.outputs.has_changes == 'true'
shell: bash
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add package.json package-lock.json esm min
git commit -m "chore: update monaco-editor to v${{ steps.monaco.outputs.version }}"
git tag "${{ steps.monaco.outputs.version }}"
git push origin "HEAD:${{ github.ref_name }}"
git push origin "${{ steps.monaco.outputs.version }}"
- name: Create GitHub release
if: steps.changes.outputs.has_changes == 'true'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.monaco.outputs.version }}
name: ${{ steps.monaco.outputs.version }}
body: |
Automated release for Monaco Editor ${{ steps.monaco.outputs.version }}.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}