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 52 53 54 55 56 57 58
|
name: AutoPub PR Workflow
on:
pull_request_target:
branches: [main]
permissions:
pull-requests: write
jobs:
check-release:
runs-on: ubuntu-latest
outputs:
has_release: ${{ steps.check.outputs.has_release }}
steps:
- uses: actions/checkout@v4
with:
ref: "refs/pull/${{ github.event.number }}/merge"
sparse-checkout: |
RELEASE.md
pyproject.toml
sparse-checkout-cone-mode: false
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Check
id: check
run: |
if uvx --from autopub==1.0.0a48 --with pygithub autopub check; then
echo "has_release=true" >> $GITHUB_OUTPUT
else
echo "has_release=false" >> $GITHUB_OUTPUT
if [ "${{ github.event_name }}" = "pull_request" ]; then
exit 1
fi
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload .autopub
if: steps.check.outputs.has_release == 'true'
run: |
if [ -d ".autopub" ]; then
echo "Found .autopub directory"
else
echo "No .autopub directory found"
exit 1
fi
- name: Upload .autopub artifact
if: steps.check.outputs.has_release == 'true'
uses: actions/upload-artifact@v4
with:
name: autopub-data
path: .autopub
include-hidden-files: true
|