Add A TestFlight Link #370
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: Add A TestFlight Link | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| app_name: | |
| description: '应用名称(可选,如不填则自动提取)' | |
| required: false | |
| default: 'None' | |
| testflight_link: | |
| description: 'TestFlight 公共测试的完整链接(非 TestFlight 链接请添加到 data/signup.md)' | |
| required: true | |
| platforms: | |
| description: '选择平台(必填:逗号分隔,多选示例:ios,ipados,macos,tvos)' | |
| required: true | |
| default: '' | |
| jobs: | |
| main: | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'pluwen/awesome-testflight-link' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python with uv | |
| run: uv venv && uv sync --locked | |
| - name: Add TestFlight Link | |
| run: | | |
| set -euo pipefail | |
| TF_LINK="${{ github.event.inputs.testflight_link }}" | |
| APP_NAME="${{ github.event.inputs.app_name }}" | |
| INPUT_PLATFORMS="${{ github.event.inputs.platforms }}" | |
| if [ "${INPUT_PLATFORMS}" = "auto" ]; then | |
| echo "[error] 'auto' platform detection is disabled. Please provide platforms in the 'platforms' input (e.g. ios,ipados)." | |
| exit 1 | |
| else | |
| echo "[info] Adding link for platforms: ${INPUT_PLATFORMS}" | |
| uv run python scripts/add_link.py "$TF_LINK" "$INPUT_PLATFORMS" "$APP_NAME" | |
| fi | |
| - name: Commit and push changes | |
| run: | | |
| if [ -n "$(git status --porcelain)" ]; then | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --global user.name "github-actions[bot]" | |
| git add . | |
| git commit -m "Add new TestFlight link: ${{ github.event.inputs.app_name }}" | |
| git push | |
| else | |
| echo "No changes to commit" | |
| fi |