-
Notifications
You must be signed in to change notification settings - Fork 5
76 lines (67 loc) · 2.32 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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