Skip to content

Commit d5d01b8

Browse files
committed
Refactor hotfix and release workflows to unify version publishing steps, streamline repository checkout, and enhance commit messages for version bumps.
1 parent 1807440 commit d5d01b8

2 files changed

Lines changed: 14 additions & 60 deletions

File tree

.github/workflows/hotfix_workflow.yml

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,12 @@ permissions:
2828
contents: write
2929

3030
jobs:
31-
prepare-version-files:
32-
name: Prepare files for hotfix
31+
publish:
32+
name: Publish version
3333
runs-on: ubuntu-latest
34-
outputs:
35-
commit_sha: ${{ steps.commit.outputs.commit }}
3634
steps:
37-
- uses: actions/checkout@v4
35+
- name: Checkout Repository
36+
uses: actions/checkout@v4
3837
with:
3938
token: ${{ secrets.PAT }}
4039

@@ -76,28 +75,18 @@ jobs:
7675
- name: Install dependencies
7776
run: pnpm install --frozen-lockfile
7877

79-
- name: Bump version
78+
- name: Bump version in package.json
8079
run: node scripts/bump-version.js "${{ github.event.inputs.version }}"
8180

82-
- name: Commit bumped package.json
83-
id: commit
81+
- name: Commit and push version bump
8482
uses: EndBug/add-and-commit@v9
8583
with:
8684
add: './package.json'
8785
committer_name: GitHub Actions
8886
committer_email: actions@github.com
8987
default_author: user_info
9088
message: 'gh-action: bumped version to ${{ github.event.inputs.version }} (hotfix)'
91-
92-
tag:
93-
name: Publish version
94-
runs-on: ubuntu-latest
95-
needs: [ prepare-version-files ]
96-
steps:
97-
- name: Checkout Repository
98-
uses: actions/checkout@v4
99-
with:
100-
ref: ${{ needs.prepare-version-files.outputs.commit_sha }}
89+
push: true
10190

10291
- name: Copilot - Create Tag
10392
uses: vypdev/copilot@v2
@@ -121,18 +110,6 @@ jobs:
121110
single-action-changelog: '${{ github.event.inputs.changelog }}'
122111
token: ${{ secrets.PAT }}
123112

124-
- name: Setup pnpm
125-
uses: pnpm/action-setup@v4
126-
127-
- name: Setup Node.js
128-
uses: actions/setup-node@v4
129-
with:
130-
node-version: 22
131-
cache: pnpm
132-
133-
- name: Install dependencies
134-
run: pnpm install --frozen-lockfile
135-
136113
- name: Prepare multiplatform package dependencies
137114
run: pnpm install --force
138115

.github/workflows/release_workflow.yml

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,12 @@ permissions:
2828
contents: write
2929

3030
jobs:
31-
prepare-version-files:
32-
name: Prepare files for release
31+
publish:
32+
name: Publish version
3333
runs-on: ubuntu-latest
34-
outputs:
35-
commit_sha: ${{ steps.commit.outputs.commit }}
3634
steps:
37-
- uses: actions/checkout@v4
35+
- name: Checkout Repository
36+
uses: actions/checkout@v4
3837
with:
3938
token: ${{ secrets.PAT }}
4039

@@ -76,28 +75,18 @@ jobs:
7675
- name: Install dependencies
7776
run: pnpm install --frozen-lockfile
7877

79-
- name: Bump version
78+
- name: Bump version in package.json
8079
run: node scripts/bump-version.js "${{ github.event.inputs.version }}"
8180

82-
- name: Commit bumped package.json
83-
id: commit
81+
- name: Commit and push version bump
8482
uses: EndBug/add-and-commit@v9
8583
with:
8684
add: './package.json'
8785
committer_name: GitHub Actions
8886
committer_email: actions@github.com
8987
default_author: user_info
9088
message: 'gh-action: bumped version to ${{ github.event.inputs.version }} (release)'
91-
92-
tag:
93-
name: Publish version
94-
runs-on: ubuntu-latest
95-
needs: [ prepare-version-files ]
96-
steps:
97-
- name: Checkout Repository
98-
uses: actions/checkout@v4
99-
with:
100-
ref: ${{ needs.prepare-version-files.outputs.commit_sha }}
89+
push: true
10190

10291
- name: Copilot - Create Tag
10392
uses: vypdev/copilot@v2
@@ -121,18 +110,6 @@ jobs:
121110
single-action-changelog: '${{ github.event.inputs.changelog }}'
122111
token: ${{ secrets.PAT }}
123112

124-
- name: Setup pnpm
125-
uses: pnpm/action-setup@v4
126-
127-
- name: Setup Node.js
128-
uses: actions/setup-node@v4
129-
with:
130-
node-version: 22
131-
cache: pnpm
132-
133-
- name: Install dependencies
134-
run: pnpm install --frozen-lockfile
135-
136113
- name: Prepare multiplatform package dependencies
137114
run: pnpm install --force
138115

0 commit comments

Comments
 (0)