Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Main workflow

on:
pull_request:
workflow_dispatch:
inputs:
yarnVersionArgs:
description: 'Arguments for "yarn version"'
required: true
type: string
default: "patch"

jobs:
run-pr:
if: github.event_name == 'pull_request'
uses: ./.github/workflows/pr.yml

run-release:
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Fail if not on master
if: github.ref != 'refs/heads/master'
run: |
echo "Error: Release workflow can only be triggered on the master branch."
exit 1
- name: Run release workflow
if: github.ref == 'refs/heads/master'
uses: ./.github/workflows/release.yml
with:
yarnVersionArgs: ${{ github.event.inputs.yarnVersionArgs }}
3 changes: 2 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Pull Request Build

on: pull_request
on:
workflow_call:

jobs:
publish:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: Bump And Publish

on:
workflow_dispatch:
workflow_call:
inputs:
yarnVersionArgs:
description: 'Arguments for "yarn version"'
required: true
type: string
default: "patch"

jobs:
Expand Down
Loading