Skip to content
Closed
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
46 changes: 46 additions & 0 deletions .github/workflows/release-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release PR ⬆️

on:
workflow_dispatch:
inputs:
bump:
description: "Version bump type (patch/minor/major)"
required: true
type: choice
default: patch
options:
- patch
- minor
- major

jobs:
release-pr:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0

- uses: fregante/setup-git-user@v2

- name: Bump version
run: npm version ${{ inputs.bump }} --no-git-tag-version

- name: Create Pull Request
env:
GH_TOKEN: ${{ github.token }}
run: |
VERSION=$(jq -r '.version' package.json)
BRANCH="release/v${VERSION}"

LAST_TAG=$(git describe --tags --abbrev=0)
BODY=$(git log ${LAST_TAG}..HEAD --oneline | grep -oE "#[0-9]+" | sort -u | sed 's/^/- /')

git checkout -b "$BRANCH"
git commit -am "release: v${VERSION}"
git push origin "$BRANCH"

gh pr create --title "release: v${VERSION}" --body "$BODY"
33 changes: 11 additions & 22 deletions .github/workflows/tagging.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,26 @@
name: Tagging 🏷️

on:
workflow_dispatch:
inputs:
bump:
description: "Version bump type (patch/minor/major)"
required: true
type: choice
default: patch
options:
- patch
- minor
- major
pull_request:
types: [closed]
branches: [main]

jobs:
create-tag:
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6

- uses: fregante/setup-git-user@v2

- name: Bump version
run: npm version ${{ inputs.bump }}

- name: Push changes
run: git push --follow-tags

- name: Draft release
- name: Create tag and release
env:
GH_TOKEN: ${{ github.token }}
run: |
NEW_VERSION="v$(jq -r '.version' package.json)"
gh release create $NEW_VERSION --draft --generate-notes
VERSION="v$(jq -r '.version' package.json)"

git tag "$VERSION"
git push origin "$VERSION"

gh release create "$VERSION" --draft --generate-notes
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "daleui",
"version": "0.0.3",
"version": "0.0.4",
"type": "module",
"repository": "github:DaleStudy/daleui",
"license": "MIT",
Expand Down