-
Notifications
You must be signed in to change notification settings - Fork 239
67 lines (54 loc) · 1.99 KB
/
push.yml
File metadata and controls
67 lines (54 loc) · 1.99 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
NAME : Publish Release to MathJax
on:
release:
types: [published]
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout MathJax-src repository
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 10
run_install: false
- name: Install dependencies
run: pnpm -s i
- name: Build MathJax
run: |
./components/bin/version
pnpm -s link:src
pnpm -s build
# - name: Get files to push from package.json
# id: get_files
# run: |
# # Extract the "files" list from package.json
# FILES=$(jq -r '.files | join(" ")' package.json)
# echo "FILES=$FILES" >> $GITHUB_ENV
- name: Create MathJax branch and push build
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
# Get the release name from the context
RELEASE_NAME="${{ github.event.release.name }}"
# Clone the MathJax repo
git clone https://github.com/MathJax/MathJax.git
cd MathJax
# Create a new branch using the release name
git checkout -b "$RELEASE_NAME"
# Copy the build output from MathJax-src repo to MathJax
cp -r ../bundle/* ./
# Add, commit, and push the changes
git add .
git commit -m "Add build artifacts for release $RELEASE_NAME"
git push origin "$RELEASE_NAME"
- name: Create a pull request in MathJax
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: MathJax/MathJax
head: "$RELEASE_NAME"
base: develop
title: "New build artifacts for release $RELEASE_NAME"
body: "This pull request contains the build artifacts from release $RELEASE_NAME."