Skip to content

Commit

Permalink
Merge pull request liferay#5944 from matuzalemsteles/uitest-bug
Browse files Browse the repository at this point in the history
chore: fix bug in clay release automation
  • Loading branch information
matuzalemsteles authored Feb 20, 2025
2 parents 33b7016 + fb1d59f commit 219e7ba
Showing 1 changed file with 116 additions and 114 deletions.
230 changes: 116 additions & 114 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,122 +1,124 @@
name: Clay Release

on:
workflow_dispatch:
inputs:
version:
required: false
description: 'Defines a specific version (e.g 3.70.0)'
type: string
workflow_dispatch:
inputs:
version:
required: false
description: 'Defines a specific version (e.g 3.70.0)'
type: string

jobs:
test:
name: Unit tests and lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '18'
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies
run: yarn install
- name: Lint
run: yarn lint
- name: Format
run: yarn format:check
- name: Verify Dependencies
run: yarn checkDeps
- name: Run Jest
env:
BROWSERSLIST_CONFIG: './packages/browserslist-config-clay/config'
BROWSERSLIST_DISABLE_CACHE: 1
CI: true
run: yarn test
test:
name: Unit tests and lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '18'
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies
run: yarn install
- name: Lint
run: yarn lint
- name: Format
run: yarn format:check
- name: Verify Dependencies
run: yarn checkDeps
- name: Run Jest
env:
BROWSERSLIST_CONFIG: './packages/browserslist-config-clay/config'
BROWSERSLIST_DISABLE_CACHE: 1
CI: true
run: yarn test

uiTest:
name: Visual Testing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies
run: yarn install
- name: Build
run: yarn build
- name: UI Tests
env:
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
run: yarn chromatic
uiTest:
name: Visual Testing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: '18'
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies
run: yarn install
- name: Build
run: yarn build
- name: UI Tests
env:
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
run: yarn chromatic

version:
name: Cut version
needs: [test, uiTest]
runs-on: ubuntu-latest
outputs:
new_sha: ${{ steps.sha.outputs.SHA }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: '18'
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn
- run: |
git config user.name github-actions
git config user.email github-actions@github.com
- name: Version
run: yarn lerna:version ${{ github.event.inputs.version }} --no-push --yes
- run: git push origin master --follow-tags
- name: Get SHA
id: sha
run: |
sha_new=$(git rev-parse HEAD)
echo $sha_new
echo "SHA=$sha_new" >> $GITHUB_OUTPUT
- run:
echo ${{ steps.sha.outputs.SHA }}
version:
name: Cut version
needs: [test, uiTest]
runs-on: ubuntu-latest
outputs:
new_sha: ${{ steps.sha.outputs.SHA }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: '18'
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn
- run: |
git config user.name github-actions
git config user.email github-actions@github.com
- name: Version
run: yarn lerna:version ${{ github.event.inputs.version }} --no-push --yes
- run: git push origin master --follow-tags
- name: Get SHA
id: sha
run: |
sha_new=$(git rev-parse HEAD)
echo $sha_new
echo "SHA=$sha_new" >> $GITHUB_OUTPUT
- run: echo ${{ steps.sha.outputs.SHA }}

publish:
name: Publish
needs: version
runs-on: ubuntu-latest
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v2
with:
ref: ${{ needs.version.outputs.new_sha }}
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
scope: '@clayui'
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: NPM Identity
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
- name: Build
run: yarn build
- name: Types
run: yarn buildTypes
- name: Git
run: git restore packages/clay-css/src/scss/_license-text.scss
- name: Publish
run: yarn lerna:publish
publish:
name: Publish
needs: version
runs-on: ubuntu-latest
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v2
with:
ref: ${{ needs.version.outputs.new_sha }}
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
scope: '@clayui'
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: NPM Identity
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
- name: Build
run: yarn build
- name: Types
run: yarn buildTypes
- name: Git
run: git restore packages/clay-css/src/scss/_license-text.scss
- name: Publish
run: yarn lerna:publish

0 comments on commit 219e7ba

Please sign in to comment.