|
21 | 21 | pull_request: |
22 | 22 | paths: |
23 | 23 | - '.github/workflows/canary-deb.yaml' |
| 24 | + - 'scripts/canary-deb.sh' |
24 | 25 |
|
25 | 26 | jobs: |
26 | | - get-latest-tag: |
27 | | - name: Get the latest release tag |
28 | | - runs-on: ubuntu-latest |
29 | | - timeout-minutes: 2 |
30 | | - outputs: |
31 | | - tag: ${{ steps.latest-tag.outputs.tag }} |
32 | | - steps: |
33 | | - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
34 | | - with: |
35 | | - fetch-depth: 0 |
36 | | - - name: 'Get the latest tag' |
37 | | - id: latest-tag |
38 | | - uses: "WyriHaximus/github-action-get-previous-tag@04e8485ecb6487243907e330d522ff60f02283ce" # v1.4.0 |
39 | | - |
40 | 27 | canary-deb: |
41 | 28 | name: Test Finch APT repo health |
42 | 29 | runs-on: ubuntu-latest |
43 | | - timeout-minutes: 3 |
44 | | - needs: get-latest-tag |
| 30 | + timeout-minutes: 2 |
45 | 31 | steps: |
46 | | - - name: Setup environment variables |
47 | | - run: | |
48 | | - ARCH=$(dpkg --print-architecture) |
49 | | - echo "ARCH=${ARCH}" >> $GITHUB_ENV |
50 | | -
|
51 | | - # Strip v from tag |
52 | | - tag=${{ needs.get-latest-tag.outputs.tag }} |
53 | | - version=${tag/v/} |
54 | | - echo "version=${version}" >> $GITHUB_ENV |
55 | | -
|
56 | | - echo "filename=runfinch-finch_${version}_${ARCH}.deb" >> $GITHUB_ENV |
57 | | - - name: Add Finch APT Repository |
58 | | - run: | |
59 | | - echo "Detected architecture: ${{ env.ARCH }}" |
60 | | - |
61 | | - curl -fsSL https://artifact.runfinch.com/deb/GPG_KEY.pub | gpg --dearmor -o /usr/share/keyrings/runfinch-finch-archive-keyring.gpg |
62 | | - echo "deb [signed-by=/usr/share/keyrings/runfinch-finch-archive-keyring.gpg arch=${{ env.ARCH }}] https://artifact.runfinch.com/deb noble main" | sudo tee /etc/apt/sources.list.d/runfinch-finch.list |
63 | | - sudo apt update |
64 | | -
|
65 | | - - name: Download latest release from GitHub |
66 | | - uses: "robinraju/release-downloader@daf26c55d821e836577a15f77d86ddc078948b05" # v1.12.0 |
| 32 | + - name: Checkout canary script |
| 33 | + uses: actions/checkout@v5 |
67 | 34 | with: |
68 | | - tag: ${{ needs.get-latest-tag.outputs.tag }} |
69 | | - fileName: ${{ env.filename }} |
70 | | - out-file-path: github-release |
71 | | - |
72 | | - - name: Download .deb from APT repo |
73 | | - run: apt-get download runfinch-finch |
74 | | - |
75 | | - - name: Verify shasum matches GitHub release shasum |
76 | | - run: | |
77 | | - apt_file=${GITHUB_WORKSPACE}/${{ env.filename }} |
78 | | - apt_file_shasum=$(sha256sum ${apt_file} | awk '{print $1}') |
79 | | -
|
80 | | -
|
81 | | - github_file=${GITHUB_WORKSPACE}/github-release/${{ env.filename }} |
82 | | - github_file_shasum=$(sha256sum ${github_file} | awk '{print $1}') |
83 | | - |
84 | | - if [[ $(diff <(echo ${apt_file_shasum}) <(echo ${github_file_shasum})) ]]; then |
85 | | - echo "❌ sha256sum mismatch!" |
86 | | - echo "apt repo shasum: ${apt_file_shasum}" |
87 | | - echo "GitHub release shasum: ${github_file_shasum}" |
88 | | - exit 1 |
89 | | - else |
90 | | - echo "✅ shasum ${apt_file_shasum} identical" |
91 | | - fi |
| 35 | + sparse-checkout: | |
| 36 | + scripts/canary-deb.sh |
| 37 | + - name: Run canary script |
| 38 | + run: ./scripts/canary-deb.sh |
0 commit comments