Skip to content

Commit 0a936a8

Browse files
committed
add release step to CI
1 parent dd8ff20 commit 0a936a8

File tree

1 file changed

+54
-1
lines changed

1 file changed

+54
-1
lines changed

.github/workflows/ci.yml

+54-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ on:
77
- '**'
88
tags:
99
- '!**'
10-
10+
workflow_dispatch:
11+
inputs:
12+
dryRun:
13+
type: boolean
14+
description: 'Run semantic-release in dry-run mode'
15+
required: true
16+
default: true
1117
jobs:
1218
ci:
1319
name: CI
@@ -27,3 +33,50 @@ jobs:
2733

2834
- name: Run tests, lint and verify package integrity
2935
run: yarn run validate
36+
37+
release:
38+
permissions:
39+
id-token: write # required for provenance
40+
actions: write # to cancel/stop running workflows (styfle/cancel-workflow-action)
41+
contents: write # to create release tags (cycjimmy/semantic-release-action)
42+
issues: write # to post release that resolves an issue (cycjimmy/semantic-release-action)
43+
44+
needs: ci
45+
runs-on: ubuntu-latest
46+
if:
47+
${{ github.repository ==
48+
'testing-library/react-render-stream-testing-library' && github.event_name
49+
== 'workflow_dispatch' }}
50+
steps:
51+
- name: Checkout repo
52+
uses: actions/checkout@v4
53+
54+
- name: Setup Node.js 22.x
55+
uses: actions/setup-node@v4
56+
with:
57+
node-version: 22.x
58+
cache: yarn
59+
60+
- name: Install dependencies
61+
run: yarn install
62+
63+
- name: 🏗 Run build script
64+
run: yarn build
65+
66+
- name: 🚀 Release
67+
uses: cycjimmy/semantic-release-action@v2
68+
with:
69+
semantic_version: 0
70+
branches: |
71+
[
72+
'+([0-9])?(.{+([0-9]),x}).x',
73+
'main',
74+
'next',
75+
'next-major',
76+
{name: 'beta', prerelease: true},
77+
{name: 'alpha', prerelease: true}
78+
]
79+
dry_run: ${{ inputs.dryRun }}
80+
env:
81+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)