-
Notifications
You must be signed in to change notification settings - Fork 2.9k
66 lines (56 loc) · 2.2 KB
/
Copy pathpublish-pr-releases.yml
File metadata and controls
66 lines (56 loc) · 2.2 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
name: Pull Request Prerelease
on:
pull_request:
push:
branches:
- "**"
tags:
- "!**"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
prerelease:
name: Pull Request Prerelease
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: ">=23.6.0"
package-manager-cache: false
- name: Check if any files in codegen/ changed
id: changed-files-codegen
uses: karpikpl/list-changed-files-action@18aa81a078f5f0f2d7f3865414fff1eba2c29a25 # 1.1.4
with:
file-filter: "codegen/**"
- name: Check if any files in scripts/codemods/ac3-to-ac4/ changed
id: changed-files-codemod
uses: karpikpl/list-changed-files-action@18aa81a078f5f0f2d7f3865414fff1eba2c29a25 # 1.1.4
with:
file-filter: "scripts/codemods/ac3-to-ac4/**"
- name: Install dependencies with cache
uses: bahmutov/npm-install@20216767ca67f0f7b4d095dc5859c5700a6581cb # v1
- name: Build AC
run: npm run build
- name: Build Codegen
if: steps.changed-files-codegen.outputs.changed_files != ''
run: npm run build
working-directory: "./codegen"
- name: Build Codemod
if: steps.changed-files-codemod.outputs.changed_files != ''
run: npm run build
working-directory: "./scripts/codemods/ac3-to-ac4"
- name: Build and publish to pkg.pr.new
env:
PACKAGE_CODEGEN: ${{ steps.changed-files-codegen.outputs.changed_files != '' && './codegen' || '' }}
PACKAGE_CODEMOD: ${{ steps.changed-files-codemod.outputs.changed_files != '' && './scripts/codemods/ac3-to-ac4' || '' }}
# skipping --compact for a moment as there is an unreleased package
run: npx pkg-pr-new publish --no-template ./dist $PACKAGE_CODEGEN $PACKAGE_CODEMOD