Skip to content

Commit 2537f11

Browse files
workflow
1 parent 10b2cf5 commit 2537f11

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Auto Merge Upstream and Publish
2+
3+
on:
4+
schedule:
5+
- cron: '0 3 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
merge-build-publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repo
13+
uses: actions/checkout@v4
14+
with:
15+
persist-credentials: false
16+
17+
- name: Set up git
18+
run: |
19+
git config user.name "github-actions[bot]"
20+
git config user.email "github-actions[bot]@users.noreply.github.com"
21+
22+
- name: Add upstream remote
23+
run: git remote add upstream https://github.com/microsoft/TypeScript.git
24+
25+
- name: Fetch upstream
26+
run: git fetch upstream
27+
28+
- name: Merge upstream/main
29+
run: git merge upstream/main
30+
31+
- name: Push changes
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
run: git push origin HEAD:operators
35+
36+
- name: Set up Node.js
37+
uses: actions/setup-node@v4
38+
with:
39+
node-version: '20'
40+
41+
- name: Install dependencies
42+
run: npm ci
43+
44+
- name: Build
45+
run: npm run build
46+
47+
- name: Run LKG build
48+
run: npx hereby LKG
49+
50+
- name: Publish to npm
51+
if: success() # Only publish if the previous steps were successful
52+
run: |
53+
npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
54+
npm publish --access public

0 commit comments

Comments
 (0)