ci(github): add auto-pr workflow to keep next and main in sync #91
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] | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- run: npm ci | |
- run: npm run lint | |
- run: npm run test | |
- run: npm run build | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: test | |
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/next' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Use Node.js 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- run: npm ci | |
- run: npm run semantic-release | |
env: | |
GITHUB_TOKEN: ${{ secrets.ADOBE_BOT_GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }} | |
- name: Opening pull request | |
id: pull | |
uses: tretuna/sync-branches@1.4.0 | |
with: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
FROM_BRANCH: "main" | |
TO_BRANCH: "next" |