chore(design-system): fix no coverage for look-and-feel react #139
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish look and feel prerelease | |
on: | |
push: | |
branches: | |
- "releases-look-and-feel/*" | |
- main | |
workflow_dispatch: | |
permissions: | |
contents: write | |
id-token: write | |
jobs: | |
build: | |
if: github.repository_owner == 'AxaFrance' | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.gitversion.outputs.fullSemVer }} | |
isStableRelease: ${{ steps.gitversion.outputs.preReleaseTag == '' }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "*" # Use the LTS Node.js version | |
cache: "npm" | |
registry-url: "https://registry.npmjs.org" | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
versionSpec: "5.x" | |
- name: Determine Version | |
id: gitversion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
useConfigFile: true | |
configFilePath: "GitVersion-look-and-feel.yml" | |
- run: npm run package:check | |
- run: npm ci | |
- run: npm run build:look-and-feel | |
- run: npm version "${{ steps.gitversion.outputs.fullSemVer }}" -w | |
client/look-and-feel/css -w client/look-and-feel/react | |
- name: Set to react package the @axa-fr/design-system-look-and-feel-css | |
dependency version | |
run: | | |
cd client/look-and-feel/react | |
jq '.peerDependencies["@axa-fr/design-system-look-and-feel-css"] = "${{ steps.gitversion.outputs.fullSemVer }}"' package.json > temp.json && mv temp.json package.json | |
- run: | | |
if [ "${{ steps.gitversion.outputs.preReleaseTag }}" = "" ]; then | |
npm publish -w client/look-and-feel/css -w client/look-and-feel/react --access public --tag latest; | |
else | |
npm publish -w client/look-and-feel/css -w client/look-and-feel/react --access public --tag next; | |
fi | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: create artifact folder | |
run: mkdir -p artifact/css & mkdir -p artifact/react | |
- name: move storybooks to artifact folders | |
run: cp -R client/look-and-feel/css/storybook-static/* artifact/css & cp -R | |
client/look-and-feel/react/storybook-static/* artifact/react | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: storybooks | |
path: | | |
artifact | |
retention-days: 2 | |
deploy: | |
needs: build | |
if: needs.build.outputs.isStableRelease == 'true' | |
runs-on: ubuntu-latest | |
name: Deploy new version of storybook to gh-pages | |
steps: | |
- name: Download storybooks | |
uses: actions/download-artifact@v4 | |
with: | |
name: storybooks | |
- name: Upload the latest react storybook | |
uses: peaceiris/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./react | |
destination_dir: look-and-feel/react/latest | |
- name: Upload the react storybook to its version folder | |
uses: peaceiris/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./react | |
destination_dir: look-and-feel/react/${{ needs.build.outputs.version }} | |
- name: Upload the latest css storybook | |
uses: peaceiris/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./css | |
destination_dir: look-and-feel/css/latest | |
- name: Upload the css to its version folder | |
uses: peaceiris/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./css | |
destination_dir: look-and-feel/css/${{ needs.build.outputs.version }} |