-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See: * https://medium.com/@johnathanmiller/github-actions-npm-version-bump-using-labels-on-pr-merge-8c716a488a64 * https://github.com/softprops/action-gh-release * https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes
- Loading branch information
1 parent
852c43e
commit c4acca8
Showing
6 changed files
with
97 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Create release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
generate_release_notes: true | ||
draft: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: 'Dev - PR Close' | ||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
types: | ||
- closed | ||
jobs: | ||
merge_pr: | ||
name: 'PR Merged' | ||
if: github.event.pull_request.merged == true | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
token: ${{ secrets.GH_ORG_PAT }} | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 20 | ||
cache: 'npm' | ||
- name: Git config | ||
run: | | ||
git config --global user.email "${{ secrets.GH_ORG_EMAIL }}" | ||
git config --global user.name "${{ secrets.GH_ORG_NAME }}" | ||
- name: Apply version bump (major) | ||
if: contains(github.event.pull_request.labels.*.name, 'major') | ||
run: npm version major | ||
- name: Apply version bump (minor) | ||
if: contains(github.event.pull_request.labels.*.name, 'minor') | ||
run: npm version minor | ||
- name: Apply version bump (patch) | ||
if: contains(github.event.pull_request.labels.*.name, 'patch') | ||
run: npm version patch | ||
- name: Git push version bump | ||
run: git push origin develop --follow-tags --force | ||
- id: set-version | ||
name: Output version change | ||
run: npm pkg get version |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: 'Dev - PR Label Checker' | ||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
types: | ||
- reopened | ||
- labeled | ||
- unlabeled | ||
jobs: | ||
check_labels: | ||
name: 'Check PR Labels' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: mheap/github-action-required-labels@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
mode: exactly | ||
count: 1 | ||
labels: 'major, minor, patch' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: 'Dev - PR Open' | ||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
types: | ||
- opened | ||
jobs: | ||
add_comment: | ||
name: 'Add Comment' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: mshick/add-pr-comment@v1 | ||
with: | ||
message: Please set a versioning label of either `major`, `minor`, or `patch` to the pull request. | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
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
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