-
Notifications
You must be signed in to change notification settings - Fork 35
98 lines (81 loc) · 2.52 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Release Projects
on:
workflow_dispatch:
push:
branches:
- main
tags-ignore:
- '*-v*'
permissions:
contents: read
pages: write
id-token: write
jobs:
release:
if: |
!startsWith(github.event.head_commit.message, 'chore(release):') &&
!startsWith(github.event.head_commit.message, 'chore(repo):')
runs-on: ubuntu-latest
name: release
steps:
- name: Checkout Commit
uses: actions/checkout@v4
with:
fetch-depth: 100
fetch-tags: true
ref: main
token: ${{ secrets.GH_TOKEN }}
- name: Fetch Tags
run: git fetch --tags
- name: Set Git Config
run: |
git config pull.rebase false
git config --global user.email "[email protected]"
git config --global user.name "Release Workflow"
git remote set-url origin https://github.com/${{ github.repository }}
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20
- name: Enable Corepack
id: pnpm-setup
run: |
corepack enable
corepack prepare pnpm@latest --activate
pnpm config set script-shell "/usr/bin/bash"
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- name: pnpm Cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-setup.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: ESLint Cache
uses: actions/cache@v3
with:
path: ./.eslintcache
key: ${{ runner.os }}-eslintcache-${{ hashFiles('./eslintcache') }}
restore-keys: |
${{ runner.os }}-eslintcache-
- name: Setup Moon
uses: moonrepo/setup-toolchain@v0
- name: Sanity Check
run: |
echo git `git version`;
echo branch `git branch --show-current`;
echo node `node -v`;
echo pnpm `pnpm -v`
echo `moon --version`
- name: pnpm install
run: pnpm install --frozen-lockfile
- name: Build Projects
run: |
moon jsx-email:build
moon create-jsx-email:build
moon run :build --query "project~plugin-*"
- name: Release
run: moon run :release --affected --concurrency 1 --remote
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}