-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (115 loc) · 3.51 KB
/
release.yaml
File metadata and controls
137 lines (115 loc) · 3.51 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Release
run-name: 🚀 Release by ${{ github.actor }}
on:
push:
branches:
- main
- beta
paths-ignore:
- docs/**
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
id-token: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: fregante/setup-git-user@v2
- name: Install pnpm
uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: 24
cache: "pnpm"
registry-url: "https://npm.pkg.github.com"
scope: "@iamyoki"
- name: Install dependencies
run: pnpm install
- name: Cache lints
id: cache-lints
uses: actions/cache@v4
with:
path: |
.eslintcache
key: ${{ runner.os }}-lints-${{ hashFiles('pnpm*', 'eslint.config.*') }}
restore-keys: |
${{ runner.os }}-lints-
- name: Lint
run: pnpm lint
# - name: Type check
# run: pnpm typecheck
- name: Test
run: pnpm test
- name: Build
run: pnpm build
- name: Print Environment Info
run: npx nx report
shell: bash
- name: Release
if: ${{ github.ref_name == 'main' }}
run: npx nx release --skip-publish
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to github packages
if: ${{ github.ref_name == 'main' }}
run: |
pnpm pkg set name=@iamyoki/committier
npx nx release publish
pnpm pkg set name=committier
shell: bash
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to npm packages
if: ${{ github.ref_name == 'main' }}
run: |
pnpm pkg set name=committier
pnpm publish --provenance --access public --registry https://registry.npmjs.org/
shell: bash
continue-on-error: true
env:
NPM_CONFIG_PROVENANCE: true
- name: Release (Beta)
if: ${{ github.ref_name == 'beta' }}
run: npx nx release --preid beta --skip-publish
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to github packages (Beta)
if: ${{ github.ref_name == 'beta' }}
run: |
pnpm pkg set name=@iamyoki/committier
npx nx release publish --tag beta
pnpm pkg set name=committier
shell: bash
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to npm packages (Beta)
if: ${{ github.ref_name == 'beta' }}
run: |
pnpm pkg set name=committier
pnpm publish --provenance --access public --no-git-checks --tag beta --registry https://registry.npmjs.org/
shell: bash
continue-on-error: true
env:
NPM_CONFIG_PROVENANCE: true
- name: Pack
run: pnpm pack
- name: Get tag
id: tag
run: |
TAG_NAME=$(git describe --tags --exact-match || echo "")
echo TAG_NAME=$TAG_NAME >> $GITHUB_OUTPUT
- name: Upload release assets
uses: softprops/action-gh-release@v2
if: ${{ steps.tag.outputs.TAG_NAME }}
with:
tag_name: ${{ steps.tag.outputs.TAG_NAME }}
files: "*.tgz"
overwrite_files: false