Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/publish-beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Publish beta lido-ui-v4

on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to release beta version from'
required: true
default: 'lido-ui-v4-canary'
push:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one is here only for debugging purposes, gonna be removed before merging


permissions:
contents: write
pages: write

jobs:
deploy:
runs-on: ubuntu-latest
env:
NODE_OPTIONS: --max_old_space_size=4096
SOURCE_BRANCH: 'release-beta-version' # ${{ github.event.inputs.branch }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ env.SOURCE_BRANCH }}
persist-credentials: false

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: 'yarn'

- name: Install Dependencies
run: yarn install --immutable

- name: Build Components
run: yarn build

- name: Publish Beta to NPM
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
# Run semantic-release and capture its output
RELEASE_OUTPUT=$(npx semantic-release -t '${version}-${{ github.workflow_sha }}' --dry-run)

# Extract the version from semantic-release output
if echo "$RELEASE_OUTPUT" | grep -q "The next release version is"; then
PACKAGE_VERSION=$(echo "$RELEASE_OUTPUT" | grep "The next release version is" | sed -E 's/.*The next release version is ([0-9]+\.[0-9]+\.[0-9]+-beta\.[0-9]+).*/\1/')
echo "Detected version: $PACKAGE_VERSION"
else
echo "No new version detected, using current version"
PACKAGE_VERSION=$(node -p "require('./package.json').version")
fi

# Actually run semantic-release
npx semantic-release -t '${version}-${{ github.workflow_sha }}'

echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV

# # Note: You need to create a Personal Access Token with 'repo' scope
# # and add it as a repository secret named REPO_ACCESS_TOKEN
# - name: Trigger workflow in target repository
# uses: peter-evans/repository-dispatch@v2
# with:
# token: ${{ secrets.REPO_ACCESS_TOKEN }}
# repository: ${{ github.event.inputs.target_repo }}
# event-type: beta-release
# client-payload: '{"version": "${{ env.PACKAGE_VERSION }}", "workflow": "${{ github.event.inputs.target_workflow }}"}'
3 changes: 3 additions & 0 deletions .releaserc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ module.exports = {
{ name: 'lido-ui-v4' },
{
name: 'lido-ui-v4-canary', "channel": "alpha", "prerelease": "alpha"
},
{
name: 'release-beta-version', "channel": "alpha", "prerelease": "beta"
}
],
plugins: [
Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,27 @@ Packages are automatically published to npm when you push to master. The publica

For correct version detection, please follow the [conventional commit format](https://www.conventionalcommits.org/en/v1.0.0/).

### Beta Releases

You can manually trigger a beta release from any branch using the GitHub Actions workflow:

1. Go to the "Actions" tab in the GitHub repository
2. Select the "Publish beta lido-ui-v4" workflow
3. Click "Run workflow"
4. Enter the following information:
- **Branch**: The branch to release from (e.g., `feature/new-component`)
- **Target Repository**: The repository where you want to trigger a workflow after the release (format: `owner/repo`)
- **Target Workflow**: The name of the workflow file to trigger in the target repository

This will:
1. Create and publish a beta version to npm with a version like `4.0.0-beta.1`
2. Deploy a Storybook instance for this beta version
3. Trigger a workflow in the specified target repository, providing the released version name

**Prerequisites**:
- You need to create a GitHub Personal Access Token with `repo` scope
- Add this token as a repository secret named `REPO_ACCESS_TOKEN`

## Customizing CSS Variables

Lido UI provides a comprehensive set of CSS variables that can be overridden to match your application's design system. This allows you to maintain the functionality of Lido UI components while adapting their appearance to your brand.
Expand Down
Loading