|
| 1 | +name: Release Binaries |
| 2 | + |
| 3 | +on: |
| 4 | + release: |
| 5 | + types: |
| 6 | + - published |
| 7 | + workflow_dispatch: |
| 8 | + inputs: |
| 9 | + ref: |
| 10 | + description: Git ref to release, usually a tag like v1.0.0 |
| 11 | + required: true |
| 12 | + type: string |
| 13 | + |
| 14 | +permissions: |
| 15 | + contents: write |
| 16 | + |
| 17 | +concurrency: |
| 18 | + group: release-binaries-${{ github.event_name == 'release' && github.event.release.tag_name || inputs.ref }} |
| 19 | + cancel-in-progress: false |
| 20 | + |
| 21 | +jobs: |
| 22 | + build: |
| 23 | + strategy: |
| 24 | + fail-fast: false |
| 25 | + matrix: |
| 26 | + include: |
| 27 | + - os: ubuntu-latest |
| 28 | + targets: linux-x64-gnu,linux-x64-musl,linux-arm64-gnu,linux-arm64-musl |
| 29 | + - os: macos-latest |
| 30 | + targets: darwin-arm64,darwin-x64 |
| 31 | + - os: windows-latest |
| 32 | + targets: windows-x64 |
| 33 | + |
| 34 | + runs-on: ${{ matrix.os }} |
| 35 | + |
| 36 | + steps: |
| 37 | + - name: Checkout |
| 38 | + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 |
| 39 | + with: |
| 40 | + ref: ${{ github.event_name == 'release' && github.event.release.tag_name || inputs.ref }} |
| 41 | + |
| 42 | + - name: Setup mise |
| 43 | + uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac |
| 44 | + |
| 45 | + - name: Build targets |
| 46 | + run: mise run build -- --targets=${{ matrix.targets }} |
| 47 | + |
| 48 | + - name: Smoke test host artifact |
| 49 | + run: bun scripts/smoke-artifact.ts |
| 50 | + |
| 51 | + - name: Upload build artifacts |
| 52 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 |
| 53 | + with: |
| 54 | + name: release-${{ matrix.os }} |
| 55 | + path: dist/* |
| 56 | + |
| 57 | + upload: |
| 58 | + needs: build |
| 59 | + runs-on: ubuntu-latest |
| 60 | + |
| 61 | + steps: |
| 62 | + - name: Checkout |
| 63 | + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 |
| 64 | + with: |
| 65 | + ref: ${{ github.event_name == 'release' && github.event.release.tag_name || inputs.ref }} |
| 66 | + |
| 67 | + - name: Setup mise |
| 68 | + uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac |
| 69 | + |
| 70 | + - name: Download build artifacts |
| 71 | + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 |
| 72 | + with: |
| 73 | + path: .artifacts |
| 74 | + merge-multiple: true |
| 75 | + |
| 76 | + - name: Assemble release assets |
| 77 | + shell: bash |
| 78 | + run: | |
| 79 | + set -euo pipefail |
| 80 | + mkdir -p dist |
| 81 | + cp .artifacts/skillet-* dist/ || true |
| 82 | + cp .artifacts/*.exe dist/ || true |
| 83 | + bun scripts/write-checksums.ts |
| 84 | +
|
| 85 | + - name: Upload release assets |
| 86 | + env: |
| 87 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 88 | + RELEASE_TAG: ${{ github.event_name == 'release' && github.event.release.tag_name || inputs.ref }} |
| 89 | + shell: bash |
| 90 | + run: | |
| 91 | + set -euo pipefail |
| 92 | + gh release upload "$RELEASE_TAG" dist/skillet-* dist/*.exe dist/SHA256SUMS --clobber |
| 93 | +
|
| 94 | + verify-homebrew: |
| 95 | + needs: upload |
| 96 | + runs-on: macos-latest |
| 97 | + env: |
| 98 | + HOMEBREW_NO_AUTO_UPDATE: 1 |
| 99 | + |
| 100 | + steps: |
| 101 | + - name: Checkout |
| 102 | + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 |
| 103 | + with: |
| 104 | + ref: ${{ github.event_name == 'release' && github.event.release.tag_name || inputs.ref }} |
| 105 | + |
| 106 | + - name: Install from Homebrew formula |
| 107 | + run: brew install --formula ./packaging/homebrew/skillet.rb |
| 108 | + |
| 109 | + - name: Verify Homebrew install |
| 110 | + run: skillet --version |
| 111 | + |
| 112 | + - name: Uninstall Homebrew formula |
| 113 | + if: always() |
| 114 | + run: brew uninstall skillet |
| 115 | + |
| 116 | + verify-chocolatey: |
| 117 | + needs: upload |
| 118 | + runs-on: windows-latest |
| 119 | + |
| 120 | + steps: |
| 121 | + - name: Checkout |
| 122 | + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 |
| 123 | + with: |
| 124 | + ref: ${{ github.event_name == 'release' && github.event.release.tag_name || inputs.ref }} |
| 125 | + |
| 126 | + - name: Pack Chocolatey package |
| 127 | + shell: pwsh |
| 128 | + run: | |
| 129 | + New-Item -ItemType Directory -Force -Path dist/choco | Out-Null |
| 130 | + choco pack packaging/chocolatey/skillet.nuspec --outputdirectory dist/choco |
| 131 | +
|
| 132 | + - name: Install from Chocolatey package |
| 133 | + shell: pwsh |
| 134 | + run: | |
| 135 | + choco install skillet --source "$PWD\dist\choco" --yes --no-progress |
| 136 | +
|
| 137 | + - name: Verify Chocolatey install |
| 138 | + shell: pwsh |
| 139 | + run: skillet --version |
| 140 | + |
| 141 | + - name: Uninstall Chocolatey package |
| 142 | + if: always() |
| 143 | + shell: pwsh |
| 144 | + run: | |
| 145 | + choco uninstall skillet --yes --no-progress |
| 146 | +
|
| 147 | + verify-winget: |
| 148 | + needs: upload |
| 149 | + runs-on: windows-latest |
| 150 | + |
| 151 | + steps: |
| 152 | + - name: Checkout |
| 153 | + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 |
| 154 | + with: |
| 155 | + ref: ${{ github.event_name == 'release' && github.event.release.tag_name || inputs.ref }} |
| 156 | + |
| 157 | + - name: Validate winget manifests |
| 158 | + shell: pwsh |
| 159 | + run: | |
| 160 | + $package = Get-Content package.json -Raw | ConvertFrom-Json |
| 161 | + $manifest = Join-Path (Join-Path packaging/winget $package.version) 'echohello-dev.skillet.yaml' |
| 162 | + winget validate $manifest |
| 163 | +
|
| 164 | + - name: Install from winget manifest |
| 165 | + shell: pwsh |
| 166 | + run: | |
| 167 | + $package = Get-Content package.json -Raw | ConvertFrom-Json |
| 168 | + $manifest = Join-Path (Join-Path packaging/winget $package.version) 'echohello-dev.skillet.yaml' |
| 169 | + winget install --manifest $manifest --accept-source-agreements --accept-package-agreements --disable-interactivity |
| 170 | +
|
| 171 | + - name: Verify winget install |
| 172 | + shell: pwsh |
| 173 | + run: skillet --version |
| 174 | + |
| 175 | + - name: Uninstall winget package |
| 176 | + if: always() |
| 177 | + shell: pwsh |
| 178 | + run: | |
| 179 | + winget uninstall --id echohello-dev.skillet --exact --disable-interactivity || exit 0 |
0 commit comments