Skip to content
Merged
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
49 changes: 46 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,55 @@ on:
- main

jobs:
release-please:
please-release:
runs-on: ubuntu-24.04
steps:
- uses: google-github-actions/release-please-action@v3.7.6 # https://github.com/googleapis/release-please-action/issues/840
- uses: actions/checkout@v4
with:
token: ${{ secrets.RELEASE_PLEASE_GITHUB_TOKEN }}
fetch-depth: 0 # need full history for tags

- name: check tags
id: check-tags
run: |
if git tag | grep -q .; then
echo "has-tags=true" >> $GITHUB_OUTPUT
else
echo "has-tags=false" >> $GITHUB_OUTPUT
echo "No tags found - will start at v0.1.0"
fi

- name: get github token
id: github-token
uses: actions/create-github-app-token@v2
with:
owner: ehmpathy
repositories: ${{ github.event.repository.name }}
app-id: ${{ vars.RHELEASE_APP_ID }}
private-key: ${{ secrets.RHELEASE_APP_PRIVATE_KEY }}

- name: upsert the tag or pr
id: release
uses: google-github-actions/release-please-action@v3.7.6 # https://github.com/googleapis/release-please-action/issues/840
with:
token: ${{ steps.github-token.outputs.token }}
release-type: node
release-as: ${{ steps.check-tags.outputs.has-tags == 'false' && '0.1.0' || null }} # ensures new packages start at a sane choice of v0, instead of their default of v1
pull-request-title-pattern: "chore(release): v${version} 🎉"
changelog-path: changelog.md

- name: upvibe the pr, if pr
if: ${{ steps.release.outputs.pr }}
run: |
PR="${{ fromJson(steps.release.outputs.pr).number }}"

body="$(gh pr view "$PR" --json body -q .body)"

updated="$(printf "%s" "$body" \
| sed '1s/^:robot: I have created a release \*beep\* \*boop\*$/🐢 noice! ready to let these changes ride?/' \
| sed 's/^### Features$/### features/' \
| sed 's/^### Bug Fixes$/### fixes/' \
)"

gh pr edit "$PR" --body "$updated"
env:
GH_TOKEN: ${{ steps.github-token.outputs.token }}
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,7 @@
},
"dependencies": {
"change-case": "^4.1.2",
"domain-objects": "0.31.3",
"helpful-errors": "1.5.3",
"joi": "17.4.0",
"rhachet": "^1.13.1",
"rhachet-roles-ehmpathy": "^1.13.3",
"type-fns": "1.21.0",
"uuid-fns": "^1.1.3"
},
Expand All @@ -84,10 +80,13 @@
"declastruct": "1.5.1",
"declastruct-github": "1.0.7",
"depcheck": "1.4.3",
"domain-objects": "^0.31.7",
"esbuild-register": "3.6.0",
"husky": "8.0.3",
"jest": "30.2.0",
"joi": "^17.2.1",
"rhachet": "^1.19.12",
"rhachet-roles-ehmpathy": "^1.17.9",
"test-fns": "1.4.2",
"tsx": "4.20.6",
"typescript": "5.4.5",
Expand Down
Loading
Loading