-
Notifications
You must be signed in to change notification settings - Fork 221
Action to push to the MathJax
repository
#1275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 "[email protected]" | ||
|
||
# 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/* ./ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You may want to remove the old files first, in case any were deleted or renamed. For example, we are not having the You might look a the 4.0.0-beta.7 package.json file's scripts to see what is currently done. |
||
|
||
# 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." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this will have been done as part of publishing the npm package, I'm wondering if we can't just install the npm package rather than rebuild everything again. That way, we are sure the two packages are actually the same.