Skip to content

Commit 502c916

Browse files
Continue preparing release action
1 parent a727d0e commit 502c916

File tree

3 files changed

+12
-25
lines changed

3 files changed

+12
-25
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ on:
1111
- patch
1212
- minor
1313
- major
14-
- custom
15-
version:
16-
description: "Custom version (e.g. v1.2.3, v0.1.2-beta.0)"
14+
prerelease:
15+
description: "Prerelease tag (e.g. beta, alpha)"
16+
required: false
1717
type: string
1818
concurrency:
1919
group: ${{ github.workflow }}
@@ -34,28 +34,15 @@ jobs:
3434
run: |
3535
git config user.name "github-actions[bot]"
3636
git config user.email "github-actions[bot]@users.noreply.github.com"
37-
- name: Validate inputs
38-
run: |
39-
if [[ "${{ github.event.inputs.increment }}" == "custom" ]]; then
40-
VERSION="${{ github.event.inputs.version }}"
41-
if [[ -z "$VERSION" ]]; then
42-
echo "❌ A version is required with a custom increment"
43-
exit 1
44-
fi
45-
if [[ ! "$VERSION" =~ ^v(\d+\.\d+\.\d+(?:-[a-z]+\.\d+)?)$ ]]; then
46-
echo "❌ The provided version is not valid"
47-
exit 1
48-
fi
49-
# Remove the "v" prefix and use as increment
50-
INCREMENT="${VERSION:1}"
51-
else
52-
INCREMENT="${{ github.event.inputs.increment }}"
53-
fi
54-
echo "INCREMENT=$INCREMENT" >> $GITHUB_OUTPUT
5537
- name: Install dependencies
5638
run: npm ci
5739
- name: Release package
58-
run: npm run release -- --increment "$INCREMENT" --ci
40+
run: |
41+
ARGS="${{ github.event.inputs.increment }} --ci"
42+
if [[ -n "${{ github.event.inputs.prerelease }}" ]]; then
43+
ARGS+=" --preRelease=${{ github.event.inputs.prerelease }}"
44+
fi
45+
npm run release -- $ARGS
5946
env:
6047
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
6148
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "frimousse",
33
"description": "An emoji picker component for React.",
4-
"version": "0.1.0",
4+
"version": "0.1.0-beta.0",
55
"license": "MIT",
66
"packageManager": "npm@11.1.0",
77
"type": "module",

0 commit comments

Comments
 (0)