Skip to content

Commit aae5864

Browse files
author
Timo Notheisen
committed
feat: convert to reusable workflow
1 parent d0ee174 commit aae5864

10 files changed

Lines changed: 598 additions & 347 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Automatic Dependency Release
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
branch:
7+
description: Branch to inspect and release from.
8+
required: false
9+
type: string
10+
default: main
11+
secrets:
12+
github-token:
13+
description: Token used to read commits and create the release.
14+
required: true
15+
16+
jobs:
17+
release:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v6
21+
with:
22+
repository: js-soft/github-actions
23+
ref: main
24+
token: ${{ secrets.github-token }}
25+
26+
- uses: actions/setup-node@v6
27+
with:
28+
node-version: current
29+
30+
- run: npm ci
31+
- run: npm run prepare-dependency-release
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.github-token }}
34+
RELEASE_BRANCH: ${{ inputs.branch }}

.github/workflows/test.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,3 @@ jobs:
1313
node-version: current
1414
- run: npm ci
1515
- run: npm run lint
16-
- run: npm run build
17-
- run: git diff --exit-code

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
node_modules
22
dist
3-
!prepare-weekly-dependency-release/dist
4-
!prepare-weekly-dependency-release/dist/**
3+
**/dist

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,26 @@
22

33
Reusable GitHub Actions for js-soft repositories.
44

5-
## prepare-weekly-dependency-release
5+
## automatic-dependency-release
66

7-
Checks whether all commits on a branch since the latest GitHub release were authored by Renovate or Dependabot. If no latest GitHub release exists, it checks all commits on the branch instead. If all checked commits are dependency-bot commits, it outputs the next patch tag for a dependency-only release.
7+
Checks whether all commits on a branch since the latest GitHub release were authored by Renovate or Dependabot. If no latest GitHub release exists, it checks all commits on the branch instead. If all checked commits are dependency-bot commits, it creates a GitHub release with generated release notes.
88

99
```yaml
10-
- name: Check dependency-only changes
11-
id: prepare
12-
uses: js-soft/github-actions/prepare-weekly-dependency-release@main
13-
with:
14-
github-token: ${{ github.token }}
15-
branch: main
10+
jobs:
11+
release:
12+
uses: js-soft/github-actions/.github/workflows/automatic-dependency-release.yml@main
13+
with:
14+
branch: main
15+
secrets:
16+
github-token: ${{ secrets.GH_PAT }}
1617
```
1718
18-
Outputs:
19+
The first release is created as `0.1.0`. Later releases increment the latest release's patch version.
1920

20-
- `should_release`: `true` when a new release should be created.
21-
- `next_tag`: the next patch tag to release. If there is no latest GitHub release, this is `0.1.0`.
21+
Secrets:
22+
23+
- `github-token`: token used to read commits and create the release. Use a PAT when the created release should trigger follow-up workflows.
2224

2325
Inputs:
2426

25-
- `github-token`: token used to read releases, compare commits, and inspect tags.
26-
- `branch`: branch to inspect. Defaults to `main`.
27+
- `branch`: branch to inspect and release from. Defaults to `main`.

0 commit comments

Comments
 (0)