This repository has been archived by the owner on Oct 23, 2024. It is now read-only.
Merge branch 'master' of https://github.com/Yuhanawa/UserScript #233
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: Update Versions and Upload to Releases Branch | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
update-and-release: | |
if: ${{ github.actor != 'github-actions[bot]' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: latest | |
run_install: true | |
- name: Update versions | |
run: pnpm run update-versions | |
- name: Build | |
run: pnpm run build | |
- name: Configure Git | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
- name: Check for changes in userscripts | |
id: check_changes | |
run: | | |
git add userscripts | |
if git diff --staged --quiet; then | |
echo "has_changes=false" >> $GITHUB_OUTPUT | |
else | |
echo "has_changes=true" >> $GITHUB_OUTPUT | |
fi | |
- name: Commit and push to master | |
if: steps.check_changes.outputs.has_changes == 'true' | |
run: | | |
git commit -m "ci: Update versions" | |
git push origin master | |
- name: push to releases branch | |
run: | | |
git add -f dist | |
git commit -m "ci: Update release files" | |
git push -f origin HEAD:releases |