Release #150
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: Release | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- 'packages/**' | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
with: | |
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | |
fetch-depth: 0 | |
- name: Setup Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- uses: dorny/paths-filter@v2 | |
id: changes | |
with: | |
filters: | | |
shopify-checkout: | |
- 'packages/shopify-checkout/**' | |
shopify-cart: | |
- 'packages/shopify-cart/**' | |
storefront-sdk-changelog: | |
- 'packages/storefront-sdk/CHANGELOG.md' | |
- name: Install Dependencies | |
run: npm ci | |
- name: Create Release Pull Request or Publish to npm | |
id: changesets | |
uses: changesets/[email protected] | |
with: | |
commit: 'build: version packages' | |
title: 'build: version packages' | |
# This expects you to have a script called release which does a build for your packages and calls changeset publish | |
publish: npm run release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NACELLE_NPMJS_TOKEN }} | |
# - name: Update and commit lockfiles | |
# if: steps.changesets.outputs.published == 'true' | |
# run: | | |
# lerna run --parallel lockfile:update | |
# git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
# git config --local user.name "github-actions[bot]" | |
# git commit -a -m "chore(publish): [skip ci] Update lockfiles" | |
# - name: Commit lockfile changes | |
# if: steps.changesets.outputs.published == 'true' | |
# uses: ad-m/[email protected] | |
# with: | |
# github_token: ${{ secrets.GITHUB_TOKEN }} | |
# branch: ${{ github.ref }} | |
- name: Shopify Checkout - npm run test:coverage | |
if: steps.changes.outputs.shopify-checkout == 'true' | |
run: npm run test:coverage | |
working-directory: packages/shopify-checkout | |
- name: Analyze with SonarCloud | |
if: steps.changes.outputs.shopify-checkout == 'true' | |
uses: sonarsource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
with: | |
projectBaseDir: packages/shopify-checkout | |
args: > | |
-Dsonar.organization=getnacelle | |
-Dsonar.projectKey=getnacelle_nacelle-js_package_shopify_checkout | |
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info | |
-Dsonar.sources=src | |
-Dsonar.exclusions=src/**/*.test.ts | |
-Dsonar.tests=src | |
-Dsonar.test.inclusions=src/**/*.test.ts | |
- name: Shopify Cart - npm run test:coverage | |
if: steps.changes.outputs.shopify-cart == 'true' | |
run: npm run test:coverage | |
working-directory: packages/shopify-cart | |
- name: Analyze with SonarCloud | |
if: steps.changes.outputs.shopify-cart == 'true' | |
uses: sonarsource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
with: | |
projectBaseDir: packages/shopify-cart | |
args: > | |
-Dsonar.organization=getnacelle | |
-Dsonar.projectKey=getnacelle_nacelle-js_package_shopify_cart | |
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info | |
-Dsonar.sources=src | |
-Dsonar.exclusions=src/**/*.test.ts | |
-Dsonar.tests=src | |
-Dsonar.test.inclusions=src/**/*.test.ts | |
- name: Add Front Matter to SDK Changelogs for Readme | |
if: steps.changes.outputs.storefront-sdk-changelog == 'true' | |
run: npm run changelog:frontmatter | |
working-directory: packages/storefront-sdk | |
- name: Sync SDK Changelogs to Readme | |
if: steps.changes.outputs.storefront-sdk-changelog == 'true' | |
uses: readmeio/rdme@v8 | |
with: | |
rdme: docs packages/storefront-sdk/changelog-readme.md --key=${{ secrets.README_API_KEY }} --version=2.0 |