Skip to content

Merge pull request #40 from loupeteam/feature/tmplit-tabs #74

Merge pull request #40 from loupeteam/feature/tmplit-tabs

Merge pull request #40 from loupeteam/feature/tmplit-tabs #74

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!"