chore: update release #16
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
actions: read | |
contents: read | |
jobs: | |
main: | |
name: 👷 CI | |
runs-on: ubuntu-latest | |
env: | |
HUSKY: 0 | |
steps: | |
- name: Checkout project | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Stetup Node.JS | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Update NPM registry path | |
run: npm run registry | |
- name: Clean install | |
run: npm ci | |
- name: Define Nx cache | |
uses: nrwl/nx-set-shas@v4 | |
- name: Prepare build | |
run: npx nx run-many -t prepare | |
- name: Check format | |
run: npx nx-cloud record -- nx format:check | |
- name: Lint & test | |
run: npx nx affected -t lint test | |
- name: Create Release Pull Request or Publish to npm | |
if: github.ref == 'refs/heads/main' | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
publish: npx changeset version | |
env: | |
HUSKY_DISABLED: 1 | |
BAL_DS_RELEASE: true | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} | |
- name: Build | |
run: npx nx affected -t build | |
# - name: Update lock file | |
# if: steps.changesets.outputs.published == 'true' | |
# run: npm install | |
# shell: bash | |
# - name: Commit lock file | |
# if: steps.changesets.outputs.published == 'true' | |
# uses: EndBug/add-and-commit@v9 | |
# with: | |
# add: 'package-lock.json' | |
# message: 'chore(): update lock file' | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# - name: Tag release | |
# if: steps.changesets.outputs.published == 'true' | |
# uses: thejeff77/action-push-tag@v1.0.0 | |
# with: | |
# tag: 'v${{ fromJson(steps.changesets.outputs.publishedPackages)[0].version }}' | |
# message: 'v${{ fromJson(steps.changesets.outputs.publishedPackages)[0].version }}' | |
# - name: Update changelog file | |
# if: steps.changesets.outputs.published == 'true' | |
# run: awk 'NR==1 {print "# Changelog"} NR!=1' packages/components/CHANGELOG.md > CHANGELOG.md | |
# shell: bash | |
# - name: Commit changelog | |
# if: steps.changesets.outputs.published == 'true' | |
# uses: EndBug/add-and-commit@v9 | |
# with: | |
# add: 'CHANGELOG.md' | |
# message: 'chore(): update changelog' | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# - name: Merge main -> production | |
# if: steps.changesets.outputs.published == 'true' | |
# uses: devmasx/merge-branch@master | |
# with: | |
# type: now | |
# from_branch: main | |
# target_branch: production | |
# message: ':bookmark: release: ${{ fromJson(steps.changesets.outputs.publishedPackages)[0].version }}' | |
# github_token: ${{ secrets.GITHUB_TOKEN }} |