Skip to content

Commit

Permalink
ci(release.yml): uses commitizen to bump version number
Browse files Browse the repository at this point in the history
  • Loading branch information
aviemet committed Oct 9, 2023
1 parent 2308b50 commit 3bee0d3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 27 deletions.
3 changes: 3 additions & 0 deletions .cz.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[tool.commitizen]
version = "0.1.0"
version_files = "package.json:3"
38 changes: 12 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,25 @@
name: Release
name: Bump version

on:
push:
branches:
- main

permissions:
contents: read # for checkout

jobs:
release:
name: Release

bump_version:
if: ${{ !startsWith(github.event.head_commit.message, 'bump:') }}
runs-on: ubuntu-latest

permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests

name: "Bump version and create changelog with commitizen"
steps:
- name: Checkout
- name: Check out
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
token: "${{ secrets.GITHUB_TOKEN }}"
- id: cz
name: Create bump and changelog
uses: commitizen-tools/commitizen-action@master
with:
node-version: "lts/*"

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: yarn release
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Print Version
run: echo "Bumped to version ${{ steps.cz.outputs.version }}"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "inventory",
"version": "0.0.0-development",
"version": "0.1.0",
"main": "index.js",
"repository": "https://github.com/aviemet/icr.git",
"author": "Avram Walden <[email protected]>",
Expand Down

0 comments on commit 3bee0d3

Please sign in to comment.