v1.1.2 #145
Workflow file for this run
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 and publish | |
on: | |
push: | |
branches: [main, beta] | |
release: | |
types: | |
- published | |
jobs: | |
yarn_build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- name: Cache node modules | |
uses: actions/cache@v4 | |
id: cache | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package.json') }} | |
- name: Install dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: yarn install --frozen-lockfile | |
- name: Build | |
run: yarn build | |
- name: Lint | |
run: yarn lint | |
semantic-release: | |
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta' }} | |
name: Create a semantic release | |
runs-on: ubuntu-latest | |
needs: | |
- yarn_build | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- name: Cache node modules | |
uses: actions/cache@v4 | |
id: cache | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package.json') }} | |
- name: Install dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: yarn install --frozen-lockfile | |
- name: Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} | |
GIT_AUTHOR_NAME: ${{ secrets.BUMP_GIT_NAME }} | |
GIT_AUTHOR_EMAIL: ${{ secrets.BUMP_GIT_EMAIL }} | |
GIT_COMMITTER_NAME: ${{ secrets.BUMP_GIT_NAME }} | |
GIT_COMMITTER_EMAIL: ${{ secrets.BUMP_GIT_EMAIL }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: yarn semantic-release | |
sync_main_to_beta: | |
if: ${{ github.ref == 'refs/heads/main' }} | |
name: Sync branch `main` to `beta` (fast-forward enabled) | |
runs-on: ubuntu-latest | |
needs: | |
- semantic-release | |
steps: | |
- name: Keep `beta` up to date with `main` (fast-forward enabled) | |
uses: jojomatik/sync-branch@v2 | |
with: | |
git_committer_name: ${{ secrets.BUMP_GIT_NAME }} | |
git_committer_email: ${{ secrets.BUMP_GIT_EMAIL }} | |
github_token: ${{ secrets.GH_TOKEN }} | |
sync_beta_to_updates: | |
if: ${{ github.ref == 'refs/heads/beta' }} | |
name: Sync branch `beta` to `updates` (fast-forward enabled) | |
runs-on: ubuntu-latest | |
needs: | |
- semantic-release | |
steps: | |
- name: Keep `updates` up to date with `beta` (fast-forward enabled) | |
uses: jojomatik/sync-branch@v2 | |
with: | |
target: "updates" | |
git_committer_name: ${{ secrets.BUMP_GIT_NAME }} | |
git_committer_email: ${{ secrets.BUMP_GIT_EMAIL }} | |
github_token: ${{ secrets.GH_TOKEN }} |