mirror of https://github.com/buster-so/buster.git
fix: Add release please syntax handler and github action (#40)
* fix(buster): Add release please syntax handler and github action * chore: add version tracking setup fix: update update nate rulez
This commit is contained in:
parent
ea23904b92
commit
dcd1d51fc7
|
@ -0,0 +1,22 @@
|
||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Run Release Please
|
||||||
|
uses: googleapis/release-please-action@v4
|
||||||
|
with:
|
||||||
|
release-type: simple
|
||||||
|
path: .
|
||||||
|
token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }}
|
||||||
|
skip-github-release: true
|
|
@ -1,73 +0,0 @@
|
||||||
name: Version Bump
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
types: [closed]
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
version-bump:
|
|
||||||
if: github.event.pull_request.merged == true
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: read
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: '20'
|
|
||||||
|
|
||||||
- name: Configure Git
|
|
||||||
run: |
|
|
||||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
|
||||||
git config --local user.name "github-actions[bot]"
|
|
||||||
|
|
||||||
- name: Determine Version Bump
|
|
||||||
id: bump
|
|
||||||
run: |
|
|
||||||
if [[ ${{ contains(github.event.pull_request.labels.*.name, 'bug') }} == 'true' ]]; then
|
|
||||||
echo "bump=patch" >> $GITHUB_OUTPUT
|
|
||||||
elif [[ ${{ contains(github.event.pull_request.labels.*.name, 'enhancement') }} == 'true' ]]; then
|
|
||||||
echo "bump=minor" >> $GITHUB_OUTPUT
|
|
||||||
elif [[ ${{ contains(github.event.pull_request.labels.*.name, 'breaking') }} == 'true' ]]; then
|
|
||||||
echo "bump=major" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "bump=none" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Bump Version
|
|
||||||
if: steps.bump.outputs.bump != 'none'
|
|
||||||
id: version
|
|
||||||
run: |
|
|
||||||
NEW_VERSION=$(npm run version:${{ steps.bump.outputs.bump }} --silent)
|
|
||||||
echo "new_version=${NEW_VERSION}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Push changes
|
|
||||||
if: steps.bump.outputs.bump != 'none'
|
|
||||||
run: |
|
|
||||||
git push
|
|
||||||
git push --tags
|
|
||||||
|
|
||||||
- name: Create GitHub Release
|
|
||||||
if: steps.bump.outputs.bump != 'none'
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
with:
|
|
||||||
tag_name: ${{ steps.version.outputs.new_version }}
|
|
||||||
name: Release ${{ steps.version.outputs.new_version }}
|
|
||||||
body: |
|
|
||||||
Changes in this release:
|
|
||||||
${{ github.event.pull_request.title }}
|
|
||||||
|
|
||||||
${{ github.event.pull_request.body }}
|
|
||||||
|
|
||||||
PR: #${{ github.event.pull_request.number }}
|
|
||||||
draft: false
|
|
||||||
prerelease: false
|
|
Loading…
Reference in New Issue