Skip to content

Commit 734b23a

Browse files
committed
build: wip - pre-release
1 parent 8a76795 commit 734b23a

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

.github/workflows/release.yaml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ on:
1010
- '.vscode/**'
1111
- '.idea/**'
1212
workflow_dispatch:
13+
inputs:
14+
production_release:
15+
description: 'Production release?'
16+
required: true
17+
default: 'true'
18+
19+
concurrency: create-release
1320

1421
permissions:
1522
contents: write # to be able to publish a GitHub release
@@ -44,7 +51,7 @@ jobs:
4451
runs-on: [ubuntu-20.04]
4552
needs:
4653
- ci
47-
name: Test semantic release
54+
name: Create release
4855
steps:
4956
- uses: actions/checkout@v4
5057
with:
@@ -55,6 +62,11 @@ jobs:
5562
with:
5663
node-version: 20
5764

65+
- name: Get branch name
66+
shell: bash
67+
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
68+
id: get_branch
69+
5870
- name: install app dependencies
5971
run: npm install
6072

@@ -63,7 +75,14 @@ jobs:
6375
env:
6476
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6577

78+
- name: create pre-release
79+
if: steps.get_branch.outputs.branch == 'main' && inputs.production_release != 'true'
80+
env:
81+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+
run: npx semantic-release --preid beta
83+
6684
- name: create release
85+
if: steps.get_branch.outputs.branch == 'main' && inputs.production_release == 'true'
6786
env:
6887
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6988
run: npx semantic-release

0 commit comments

Comments
 (0)