Merge branch 'main' of https://github.com/lcandy2/Chaoxing-Auto #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Use pnpm | |
uses: pnpm/[email protected] | |
with: | |
version: "8" | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build | |
run: pnpm build | |
- name: Commit and push | |
uses: actions-js/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
message: "action: build script" | |
- name: Format dist files | |
run: | | |
mkdir export | |
cp README.md ./export/README.md | |
cp ./dist/chaoxing-auto.user.js ./export/Chaoxing-Auto.user.js | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: build-artifact | |
path: | | |
./export/ | |
push-to-userjs: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout user.js repository | |
uses: actions/checkout@v4 | |
with: | |
repository: lcandy2/user.js | |
token: ${{ secrets.ACCESS_TOKEN }} # Make sure to set this in your repo secrets | |
path: ./export/user-js | |
- name: Download artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: build-artifact | |
path: ./export/user-js/chaoxing.com | |
- name: Commit and push to user.js | |
uses: actions-js/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
repository: lcandy2/user.js | |
directory: ./export/user-js | |
message: "action: Update Chaoxing Auto" |