-
Notifications
You must be signed in to change notification settings - Fork 214
61 lines (58 loc) · 1.86 KB
/
Copy pathrelease-pr.yml
File metadata and controls
61 lines (58 loc) · 1.86 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
name: release-pr
on:
pull_request:
types: [labeled]
permissions:
contents: read
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}
cancel-in-progress: true
jobs:
next-drupal:
runs-on: ubuntu-latest
timeout-minutes: 15
if: |
contains(github.event.pull_request.labels.*.name, format('release-pr{0} next-drupal', ':')) &&
github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name
environment: Preview
steps:
- name: Init
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Determine version
uses: ./.github/version-pr
id: determine-version
env:
PR_NUMBER: ${{ github.event.number }}
- name: Publish to npm
run: |
cd packages/next-drupal
yarn publish --no-git-checks --access public --tag experimental
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Comment version on PR
env:
VERSION: ${{ steps.determine-version.outputs.version }}
PR_NUMBER: ${{ github.event.number }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr comment "$PR_NUMBER" --body "🎉 Experimental release [published 📦️ on npm](https://npmjs.com/package/next-drupal/v/$VERSION)!
\`\`\`sh
pnpm add next-drupal@$VERSION
\`\`\`
\`\`\`sh
yarn add next-drupal@$VERSION
\`\`\`
\`\`\`sh
npm i next-drupal@$VERSION
\`\`\`"