release: [skip apps] bump npm package(s) (#831) #440
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 | |
permissions: | |
id-token: write | |
contents: write | |
packages: write | |
pull-requests: write | |
issues: read | |
on: | |
push: | |
paths: | |
- ".changeset/**" | |
- "packages/**" | |
branches: | |
- develop | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
# see here: https://docs.github.com/en/actions/learn-github-actions/expressions#example-matching-an-array-of-strings | |
if: ${{ contains(fromJSON('["tuanddd", "zlatanpham", "chinhld12", "trankhacvy", "tienan92it", "vdhieu", "leduyhien152", "nguyend-nam", "tonible14012002", "github-actions[bot]", "github-actions"]'), github.triggering_actor) }} | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v4 | |
with: | |
# see `fetch-depth` in README: https://github.com/actions/checkout#checkout-v4, | |
# we set to `0` so the referenced commits are available for the command below | |
fetch-depth: 0 | |
- name: Prepare Environment | |
uses: ./.github/actions/setup-env | |
timeout-minutes: 10 | |
with: | |
enable-turbo-cache: true | |
- name: Creating .npmrc file | |
run: | | |
cp .npmrc.example .npmrc | |
sed -i "s/NPM_ACCESS_TOKEN/$NPM_TOKEN/g" .npmrc | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Build | |
run: pnpm build:packages | |
- name: Create Release Pull Request or Publish Packages | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
publish: pnpm release | |
version: pnpm version-packages | |
commit: 'release: [skip apps] bump npm package(s)' | |
title: 'release: [skip apps] npm package(s)' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Send Discord Msg | |
if: steps.changesets.outputs.published == 'true' | |
uses: './.github/actions/discord-notify' | |
with: | |
discord-webhook: ${{ secrets.DISCORD_WEBHOOK }} | |
tags-info: ${{ steps.changesets.outputs.publishedPackages }} | |
repo: ${{ github.repository }} | |
server-url: ${{ github.server_url }} | |
- name: Archive npm failure logs | |
uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: npm-logs | |
path: ~/.npm/_logs |