Skip to content

Commit

Permalink
ci: adding releases action
Browse files Browse the repository at this point in the history
  • Loading branch information
aacevski committed Feb 17, 2025
1 parent d5d55f9 commit 340370e
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,28 @@ jobs:
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
node-version: '20'
bun-version: latest

- name: Install dependencies
run: |
npm install -g conventional-changelog-cli
npm install -g conventional-recommended-bump
bun add -g conventional-changelog-cli
bun add -g conventional-recommended-bump
bun add -g conventional-changelog-angular
- name: Get version bump
id: bump
if: ${{ !inputs.version }}
run: |
BUMP=$(conventional-recommended-bump -p angular)
BUMP=$(bunx conventional-recommended-bump -p angular)
echo "bump=$BUMP" >> $GITHUB_OUTPUT
- name: Get current version
id: current_version
run: |
VERSION=$(node -p "require('./package.json').version")
VERSION=$(bun x jq -r .version package.json)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Calculate new version
Expand All @@ -52,7 +53,7 @@ jobs:
NEW_VERSION=${{ inputs.version }}
else
BUMP=${{ steps.bump.outputs.bump }}
NEW_VERSION=$(node -e "
NEW_VERSION=$(bun run -e "
const semver = require('semver');
const current = '$CURRENT_VERSION';
const bump = '$BUMP';
Expand All @@ -64,11 +65,11 @@ jobs:
- name: Update version in package.json
run: |
NEW_VERSION=${{ steps.new_version.outputs.version }}
npm version $NEW_VERSION --no-git-tag-version
bun x npm version $NEW_VERSION --no-git-tag-version
- name: Generate changelog
run: |
conventional-changelog -p angular -i CHANGELOG.md -s
bunx conventional-changelog -p angular -i CHANGELOG.md -s
- name: Create Release Commit
run: |
Expand Down

0 comments on commit 340370e

Please sign in to comment.