-
Notifications
You must be signed in to change notification settings - Fork 604
89 lines (86 loc) · 2.63 KB
/
dev-releases-for-pr.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
name: Release Dev Build for PR
on:
pull_request:
types:
- opened
- synchronize
jobs:
setup:
if: github.event.pull_request.draft == false
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-12]
timeout-minutes: 30
outputs:
plugins: ${{ steps.packages.outputs.paths }}
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@ce177499ccf9fd2aded3b0426c97e5434c2e8a73
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Get Latest
uses: actions/setup-node@v3
with:
node-version: 18.18.0
- uses: actions/checkout@v3
- name: Restore Dependency Cache
id: cache-modules
uses: actions/cache@v3
with:
path: |
node_modules
*/node_modules
key: ${{ runner.os }}-dependency-caching-${{ hashFiles('package.json', '*/package.json') }}
- run: npm install
- id: files
uses: tj-actions/changed-files@v37
with:
json: true
write_output_files: true
- id: catjson
run: |
echo "FILES_JSON=$(cat .github/outputs/all_changed_files.json)" >> $GITHUB_OUTPUT
- id: packages
uses: ./.github/actions/changed-packages
with:
files: ${{ steps.catjson.outputs.FILES_JSON }}
release-dev-of-plugins:
runs-on: macos-12
timeout-minutes: 30
permissions:
pull-requests: write
needs:
- setup
strategy:
matrix:
plugin: ${{ fromJson(needs.setup.outputs.plugins) }}
steps:
- uses: actions/setup-node@v3
with:
node-version: 18.18.0
- uses: actions/checkout@v3
- name: Restore Dependency Cache
id: cache-modules
uses: actions/cache@v3
with:
path: |
node_modules
*/node_modules
key: ${{ runner.os }}-dependency-caching-${{ hashFiles('package.json', '*/package.json') }}
- run: npm install
- env:
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
npm version prerelease --no-git-tag-version -f --preid dev-$PR_NUMBER-$(date + %Y%m%dT%H%M%S)
npm publish --tag dev --dry-run
working-directory: ${{ matrix.plugin }}
- name: get-npm-version
id: package-version
uses: martinbeentjes/[email protected]
with:
path: ${{ matrix.plugin }}
- uses: mshick/add-pr-comment@v2
with:
message: |
Released dev build of ${{ matrix.plugin }} with dev version: ${{ steps.package-version.outputs.current-version }}