Skip to content

Commit

Permalink
add release step to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas committed Oct 11, 2024
1 parent e5645c0 commit 535b49e
Showing 1 changed file with 54 additions and 1 deletion.
55 changes: 54 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ on:
- '**'
tags:
- '!**'

workflow_dispatch:
inputs:
dryRun:
type: boolean
description: 'Run semantic-release in dry-run mode'
required: true
default: true
jobs:
ci:
name: CI
Expand All @@ -27,3 +33,50 @@ jobs:

- name: Run tests, lint and verify package integrity
run: yarn run validate

release:
permissions:
id-token: write # required for provenance
actions: write # to cancel/stop running workflows (styfle/cancel-workflow-action)
contents: write # to create release tags (cycjimmy/semantic-release-action)
issues: write # to post release that resolves an issue (cycjimmy/semantic-release-action)

needs: ci
runs-on: ubuntu-latest
if:
${{ github.repository ==
'testing-library/react-render-stream-testing-library' && github.event_name
== 'workflow_dispatch' }}
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: yarn

- name: Install dependencies
run: yarn install

- name: 🏗 Run build script
run: yarn build

- name: 🚀 Release
uses: cycjimmy/semantic-release-action@v2
with:
semantic_version: 0
branches: |
[
'+([0-9])?(.{+([0-9]),x}).x',
'main',
'next',
'next-major',
{name: 'beta', prerelease: true},
{name: 'alpha', prerelease: true}
]
dry_run: ${{ inputs.dryRun }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 535b49e

Please sign in to comment.