-
Notifications
You must be signed in to change notification settings - Fork 3
52 lines (50 loc) · 1.68 KB
/
push_next.yml
File metadata and controls
52 lines (50 loc) · 1.68 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
name: 'Publish next'
on:
workflow_run:
workflows:
- 'CI'
types:
- completed
branches:
- main
workflow_dispatch:
permissions:
id-token: write
jobs:
build:
name: Build & Release
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch' || (github.event.workflow_run.conclusion == 'success') && ${{ startsWith(github.repository, 'eclipse-daanse/') && (github.ref == 'refs/heads/main') && (github.event_name != 'pull_request') }}
env:
changes: true
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
with:
# To fetch all history for all branches and tags.
# Required for lerna to determine the version of the next package.
fetch-depth: 0
ref: ${{ github.event.workflow_run.head_commit.id || github.sha }}
- name: Check for changes in "packages" directory
id: check_changes
run: |
if git diff --name-only HEAD^ HEAD | grep -qE '^packages'; then
echo "changes=true" >> $GITHUB_ENV
else
echo "changes=false" >> $GITHUB_ENV
fi
if: github.event_name == 'workflow_run'
- uses: actions/setup-node@v6.3.0
with:
node-version: 20.x
registry-url: 'https://registry.npmjs.org'
if: env.changes == 'true'
- uses: actions/setup-python@v6.2.0
with:
python-version: '3.11'
if: env.changes == 'true'
- name: Publish NPM
run: lerna publish from-package --dist-tag next -y
env:
NPM_CONFIG_PROVENANCE: 'true'
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }}
if: env.changes == 'true'