-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (48 loc) · 1.37 KB
/
publish-widgets.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
name: Publish Tmplits
on:
push:
branches:
- main
- prelux/main
jobs:
list-tmplits:
runs-on: ubuntu-latest
defaults:
run:
working-directory: src/tmplits
steps:
- uses: actions/checkout@v3
- name: List Tmplits
id: list_step
run: |
tmplits=$(find . -maxdepth 1 -type d | awk 'NR>1' | sed 's|./||' | sed '/^\s*$/d' | sed "s|.*|'&'|")
echo "tmplits=[$(echo "$tmplits" | paste -sd, -)]"
echo "tmplits=[$(echo "$tmplits" | paste -sd, -)]" >> $GITHUB_OUTPUT
outputs:
tmplits: ${{ steps.list_step.outputs.tmplits }}
publish-all:
needs: list-tmplits
runs-on: ubuntu-latest
strategy:
matrix:
tmplit: ${{fromJson(needs.list-tmplits.outputs.tmplits)}}
defaults:
run:
working-directory: src/tmplits/${{ matrix.tmplit }}
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://npm.pkg.github.com/
- uses: JS-DevTools/npm-publish@v2
id: publish
with:
token: ${{ secrets.GITHUB_TOKEN }}
registry: "https://npm.pkg.github.com"
package: src/tmplits/${{ matrix.tmplit }}
- if: ${{ steps.publish.outputs.type }}
run: echo "Version changed!"