mirror of
https://github.com/sveltejs/ai-tools.git
synced 2026-09-14 13:50:38 +08:00
67 lines
1.8 KiB
YAML
67 lines
1.8 KiB
YAML
name: Release Svelte Skills
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'tools/skills/**'
|
|
workflow_dispatch:
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
detect-skills:
|
|
permissions:
|
|
contents: read
|
|
if: github.repository == 'sveltejs/ai-tools'
|
|
name: Detect changed skills
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
skills: ${{ steps.find-skills.outputs.skills }}
|
|
steps:
|
|
- name: checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Find all skills
|
|
id: find-skills
|
|
run: |
|
|
skills=$(ls -d tools/skills/*/ | xargs -I {} basename {} | jq -R -s -c 'split("\n") | map(select(length > 0))')
|
|
echo "skills=$skills" >> $GITHUB_OUTPUT
|
|
|
|
release:
|
|
needs: detect-skills
|
|
if: needs.detect-skills.outputs.skills != '[]'
|
|
permissions:
|
|
contents: write
|
|
name: Release ${{ matrix.skill }}
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
skill: ${{ fromJson(needs.detect-skills.outputs.skills) }}
|
|
steps:
|
|
- name: checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Get version from date
|
|
id: version
|
|
run: echo "version=$(date +'%Y.%m.%d-%H%M%S')" >> $GITHUB_OUTPUT
|
|
|
|
- name: Create zip
|
|
run: |
|
|
cd tools/skills
|
|
zip -r ${{ matrix.skill }}.zip ${{ matrix.skill }}/
|
|
|
|
- name: Create Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: ${{ matrix.skill }}-v${{ steps.version.outputs.version }}
|
|
name: ${{ matrix.skill }} v${{ steps.version.outputs.version }}
|
|
body: |
|
|
Automated release of the ${{ matrix.skill }} skill.
|
|
|
|
This release was triggered by changes to the `tools/skills/${{ matrix.skill }}/` directory.
|
|
files: tools/skills/${{ matrix.skill }}.zip
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|