Skip to content

Commit 6ac0541

Browse files
committed
Release on every tag and commit on main; Publish every tag
1 parent c635f38 commit 6ac0541

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

.github/workflows/publish.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@ name: Publish NPM package
22
permissions:
33
contents: write
44
on:
5-
workflow_run:
6-
workflows: ["Run Tests"]
5+
push:
76
tags:
87
- '*'
9-
types:
10-
- completed
118
jobs:
9+
tests:
10+
uses: ./.github/workflows/tests.yml # Run tests
1211
publish:
1312
runs-on: ubuntu-latest
14-
# Require tests to pass before publish
15-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
13+
needs: [tests] # Require tests to pass before publish
1614
steps:
1715
- name: Checkout
1816
uses: actions/checkout@v4

.github/workflows/release.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,17 @@ name: Release
22
permissions:
33
contents: write
44
on:
5-
workflow_run:
6-
workflows: ["Run Tests"]
5+
push:
76
tags:
87
- '*'
98
branches:
109
- main
11-
types:
12-
- completed
1310
jobs:
11+
tests:
12+
uses: ./.github/workflows/tests.yml # Run tests
1413
build:
1514
runs-on: ubuntu-latest
16-
# Require tests to pass before release
17-
# https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#running-a-workflow-based-on-the-conclusion-of-another-workflow
18-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
15+
needs: [tests] # Require tests to pass before release
1916
steps:
2017
- name: Checkout
2118
uses: actions/checkout@v4

.github/workflows/tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ permissions:
33
contents: write
44
on:
55
push:
6+
branches:
7+
- '!main'
68
workflow_call: # Allow this workflow to be called from other workflows
79
jobs:
810
tests:

0 commit comments

Comments
 (0)