fix: witchcraft #57
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: Automatic Versioning | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: Cache Node.js dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.bun | |
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }} | |
restore-keys: | | |
${{ runner.os }}-bun- | |
- uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- name: Install dependencies | |
run: | | |
bun install | |
- name: Trigger Bundle Update | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
await github.actions.createWorkflowDispatch({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
workflow_id: 'Bundle Update.yml', | |
ref: context.ref | |
}); | |
- name: Wait for Bundle Update | |
uses: jakejarvis/wait-action@v1 | |
with: | |
workflow: "Bundle Update" | |
ref: ${{ github.sha }} | |
repo: ${{ github.repository }} | |
- uses: google-github-actions/release-please-action@v3 | |
id: release | |
with: | |
token: ${{ secrets.RELEASE_GITHUB_TOKEN }} | |
package-name: "init-beatsaber" | |
release-type: node | |
- name: Tag and push subversions | |
if: ${{ steps.release.outputs.releases_created }} | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "BeatForge CI" | |
git fetch --tags | |
git tag -d v${{ steps.release.outputs.major }} || true | |
git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true | |
git push origin :v${{ steps.release.outputs.major }} || true | |
git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true | |
git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}" | |
git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}" | |
git push origin v${{ steps.release.outputs.major }} | |
git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} |