Skip to content

Commit bc5b9e3

Browse files
committed
ci(release): improve release workflow
Ref: #65 Signed-off-by: Philip Gerke <me@philipgerke.com>
1 parent c047d5a commit bc5b9e3

File tree

5 files changed

+51
-26
lines changed

5 files changed

+51
-26
lines changed

.github/actions/detect-version-change/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: "Detect commitizen version change"
2-
description: "Checks if the 'version' key in .cz.json has changed compared to the previous commit."
2+
description: "Checks if the 'version' key in package.json has changed compared to the previous commit."
33
outputs:
44
version_changed:
55
description: "Boolean indicating if the version has changed"
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
on:
2+
- workflow_call
3+
4+
jobs:
5+
cache_dependencies:
6+
name: Cache dependencies
7+
runs-on: ubuntu-latest
8+
outputs:
9+
pnpm-store-path: ${{ steps.pnpm-store-path.outputs.store-path }}
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v4
13+
- name: Setup Node.js
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version: lts/*
17+
- name: Setup pnpm
18+
uses: pnpm/action-setup@v4
19+
- name: Get pnpm store path
20+
id: pnpm-store-path
21+
run: echo "store-path=$(pnpm store path)" >> $GITHUB_OUTPUT
22+
- name: Cache pnpm store
23+
uses: actions/cache@v4
24+
with:
25+
path: ${{ steps.pnpm-store-path.outputs.store-path }}
26+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
27+
restore-keys: |
28+
${{ runner.os }}-pnpm-store-
29+
- name: Restore dependencies
30+
run: pnpm install --frozen-lockfile

.github/workflows/release.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,16 @@ jobs:
4242
env:
4343
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4444

45+
cache_dependencies:
46+
name: Cache dependencies
47+
uses: ./.github/workflows/dependency_cache.yml
48+
needs: [check_release_trigger]
49+
secrets: inherit
50+
4551
deploy:
4652
name: Deploy Library
4753
runs-on: ubuntu-latest
48-
needs: [check_release_trigger]
54+
needs: [cache_dependencies]
4955
if: ${{ needs.check_release_trigger.outputs.version_changed == 'true' && !contains(github.event.head_commit.message, '[skip deploy]') }}
5056
steps:
5157
- name: Checkout code

.github/workflows/shared.yml

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,8 @@ on:
44
jobs:
55
cache_dependencies:
66
name: Cache dependencies
7-
runs-on: ubuntu-latest
8-
outputs:
9-
pnpm-store-path: ${{ steps.pnpm-store-path.outputs.store-path }}
10-
steps:
11-
- name: Checkout repository
12-
uses: actions/checkout@v4
13-
- name: Setup Node.js
14-
uses: actions/setup-node@v4
15-
with:
16-
node-version: lts/*
17-
- name: Setup pnpm
18-
uses: pnpm/action-setup@v4
19-
- name: Get pnpm store path
20-
id: pnpm-store-path
21-
run: echo "store-path=$(pnpm store path)" >> $GITHUB_OUTPUT
22-
- name: Cache pnpm store
23-
uses: actions/cache@v4
24-
with:
25-
path: ${{ steps.pnpm-store-path.outputs.store-path }}
26-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
27-
restore-keys: |
28-
${{ runner.os }}-pnpm-store-
29-
- name: Restore dependencies
30-
run: pnpm install --frozen-lockfile
7+
uses: ./.github/workflows/dependency_cache.yml
8+
secrets: inherit
319

3210
build:
3311
name: Build

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://
77
semver.org/spec/v2.0.0.html).
88

9+
# 1.4.12 - 22.03.2025
10+
11+
### Added
12+
13+
- [#65](https://github.com/pgerke/freeathome-local-api-client/issues/65):
14+
Release workflow and development tooling enhancement
15+
16+
### Changed
17+
18+
- NO-TICKET: Bump dependencies
19+
920
# 1.4.11 - 28.12.2024
1021

1122
### Added

0 commit comments

Comments
 (0)