|
12 | 12 | APT_COMPONENT: ${{ vars.APT_COMPONENT || 'hatlabs' }} |
13 | 13 |
|
14 | 14 | jobs: |
15 | | - trigger-packaging: |
| 15 | + dispatch-to-apt: |
16 | 16 | runs-on: ubuntu-latest |
17 | | - # Only handle stable releases - pre-releases are handled by auto-prerelease.yml |
| 17 | + # Only handle stable releases - pre-releases are handled by main.yml |
18 | 18 | if: ${{ github.event.release.prerelease == false }} |
19 | 19 | steps: |
20 | | - - name: Trigger APT repository |
21 | | - uses: peter-evans/repository-dispatch@v4 |
22 | | - with: |
23 | | - token: ${{ secrets.REPO_DISPATCH_PAT }} |
24 | | - repository: hatlabs/apt.hatlabs.fi |
25 | | - event-type: package-updated |
26 | | - client-payload: | |
27 | | - { |
28 | | - "repository": "${{ github.repository }}", |
29 | | - "distro": "${{ env.APT_DISTRO }}", |
30 | | - "channel": "stable", |
31 | | - "component": "${{ env.APT_COMPONENT }}" |
32 | | - } |
| 20 | + - name: Verify release has assets |
| 21 | + run: | |
| 22 | + STABLE_TAG="${{ github.event.release.tag_name }}" |
| 23 | + ASSET_COUNT=$(gh release view "$STABLE_TAG" --repo ${{ github.repository }} --json assets --jq '.assets | length') |
| 24 | +
|
| 25 | + if [ "$ASSET_COUNT" -eq 0 ]; then |
| 26 | + echo "❌ Error: Release has no assets attached" |
| 27 | + echo "The .deb package should have been attached when the draft was created" |
| 28 | + exit 1 |
| 29 | + fi |
| 30 | +
|
| 31 | + echo "✅ Release has $ASSET_COUNT asset(s)" |
| 32 | + env: |
| 33 | + GH_TOKEN: ${{ github.token }} |
| 34 | + |
| 35 | + - name: Trigger APT repository |
| 36 | + uses: peter-evans/repository-dispatch@v4 |
| 37 | + with: |
| 38 | + token: ${{ secrets.REPO_DISPATCH_PAT }} |
| 39 | + repository: hatlabs/apt.hatlabs.fi |
| 40 | + event-type: package-updated |
| 41 | + client-payload: | |
| 42 | + { |
| 43 | + "repository": "${{ github.repository }}", |
| 44 | + "distro": "${{ env.APT_DISTRO }}", |
| 45 | + "channel": "stable", |
| 46 | + "component": "${{ env.APT_COMPONENT }}" |
| 47 | + } |
| 48 | +
|
| 49 | + - name: Report success |
| 50 | + run: | |
| 51 | + STABLE_TAG="${{ github.event.release.tag_name }}" |
| 52 | +
|
| 53 | + echo "=== Stable Release Published ===" |
| 54 | + echo "Stable tag: $STABLE_TAG" |
| 55 | + echo "Release URL: https://github.com/${{ github.repository }}/releases/tag/$STABLE_TAG" |
| 56 | + echo "" |
| 57 | + echo "✅ Dispatched to apt.hatlabs.fi stable channel" |
0 commit comments