fix: exclude unsupported assets from SkillHub release #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish to SkillHub | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: skillhub-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| environment: skillhub-production | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Validate tag and Skill | |
| shell: bash | |
| run: | | |
| python tools/validate_skill.py --expected-version "${GITHUB_REF_NAME}" | |
| python -m unittest discover -s tests -v | |
| - name: Install SkillHub CLI | |
| shell: bash | |
| run: | | |
| SKILLHUB_KIT_VERSION="2026.8.5" | |
| SKILLHUB_ARCHIVE="/tmp/skillhub-cli-${SKILLHUB_KIT_VERSION}.tar.gz" | |
| curl --fail --show-error --silent --location \ | |
| "https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub-cli-${SKILLHUB_KIT_VERSION}.tar.gz" \ | |
| --output "${SKILLHUB_ARCHIVE}" | |
| echo "3bbe2ba15ada2eb7a94a2b760fead83be5f4164ab28a6c8b0944dbc539f7e236 ${SKILLHUB_ARCHIVE}" \ | |
| | sha256sum --check --status | |
| mkdir -p /tmp/skillhub-cli | |
| tar -xzf "${SKILLHUB_ARCHIVE}" -C /tmp/skillhub-cli | |
| bash /tmp/skillhub-cli/cli/install.sh \ | |
| --cli-only \ | |
| --kit-version "${SKILLHUB_KIT_VERSION}" \ | |
| --no-self-upgrade | |
| echo "${HOME}/.local/bin" >> "${GITHUB_PATH}" | |
| - name: Stage SkillHub files | |
| shell: bash | |
| run: | | |
| skillhub_skill_dir="${RUNNER_TEMP}/yinchao-ai-music" | |
| mkdir -p "${skillhub_skill_dir}" | |
| cp skills/yinchao-ai-music/SKILL.md "${skillhub_skill_dir}/" | |
| cp -R \ | |
| skills/yinchao-ai-music/references \ | |
| skills/yinchao-ai-music/scripts \ | |
| "${skillhub_skill_dir}/" | |
| echo "SKILLHUB_SKILL_DIR=${skillhub_skill_dir}" >> "${GITHUB_ENV}" | |
| - name: SkillHub dry run | |
| shell: bash | |
| run: skillhub publish "${SKILLHUB_SKILL_DIR}" --dry-run --json | |
| - name: Publish SkillHub release | |
| env: | |
| SKILLHUB_TOKEN: ${{ secrets.SKILLHUB_TOKEN }} | |
| shell: bash | |
| run: | | |
| if [[ -z "${SKILLHUB_TOKEN}" ]]; then | |
| echo "Missing GitHub Actions secret: SKILLHUB_TOKEN" >&2 | |
| exit 1 | |
| fi | |
| skillhub publish "${SKILLHUB_SKILL_DIR}" \ | |
| --token "${SKILLHUB_TOKEN}" \ | |
| --host https://api.skillhub.cn \ | |
| --changelog "GitHub Release ${GITHUB_REF_NAME}" \ | |
| --json | |
| - name: Create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| shell: bash | |
| run: | | |
| gh release view "${GITHUB_REF_NAME}" >/dev/null 2>&1 || \ | |
| gh release create "${GITHUB_REF_NAME}" \ | |
| --title "${GITHUB_REF_NAME}" \ | |
| --generate-notes |