Skip to content

Commit 743c3f4

Browse files
authored
move prepare-release steps into create-new-release (#1271)
1 parent 731df52 commit 743c3f4

File tree

2 files changed

+50
-86
lines changed

2 files changed

+50
-86
lines changed

.github/workflows/create-new-release.yml

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
name: "Create new release"
22

3-
on: workflow_dispatch
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "Select the version increment"
8+
required: true
9+
type: choice
10+
options:
11+
- major
12+
- minor
13+
- patch
14+
- premajor
15+
- preminor
16+
- prepatch
17+
- prerelease
418

519
jobs:
620
create-new-release:
@@ -21,12 +35,45 @@ jobs:
2135
- name: Setup env
2236
run: echo "FONTAWESOME_NPM_AUTH_TOKEN=${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}" > .env
2337

24-
- name: Install dependencies
25-
run: yarn install
38+
- name: Bump version in package.json
39+
run: yarn version ${{ github.event.inputs.version }}
40+
41+
- name: Extract version from package.json
42+
id: extract_version
43+
run: |
44+
version=$(grep '"version"' package.json | sed -E 's/.*"version": "([^"]+)".*/\1/')
45+
echo "Extracted version: $version"
46+
echo "::set-output name=version::$version"
47+
48+
- name: Create version bump branch
49+
run: git checkout -b release/v${{ steps.extract_version.outputs.version }}
2650

2751
- name: Initialize mandatory git config
2852
uses: fregante/setup-git-user@v2
2953

54+
- name: Commit manifest files
55+
id: make-commit
56+
run: |
57+
git add package.json
58+
git commit --message "Update package.json v${{ steps.extract_version.outputs.version }}"
59+
60+
echo "::set-output name=commit::$(git rev-parse HEAD)"
61+
62+
- name: Publish release branch
63+
run: git push origin release/v${{ steps.extract_version.outputs.version }}
64+
65+
- name: Merge version update into main branch
66+
uses: thomaseizinger/[email protected]
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
with:
70+
head: release/v${{ steps.extract_version.outputs.version }}
71+
base: main
72+
title: "Merge release/v${{ steps.extract_version.outputs.version }} into main branch"
73+
74+
- name: Install dependencies
75+
run: yarn install
76+
3077
# Build assets
3178
- run: yarn build
3279
- run: npm pack

.github/workflows/prepare-release.yml

Lines changed: 0 additions & 83 deletions
This file was deleted.

0 commit comments

Comments
 (0)