|
| 1 | +# Stage PyInstaller application packages through GitHub Actions (GHA) to GitHub Workflow Artifacts section. |
| 2 | +# https://github.com/actions/upload-artifact#where-does-the-upload-go |
| 3 | +name: "Release: Application Bundle" |
| 4 | + |
| 5 | +on: |
| 6 | + pull_request: ~ |
| 7 | + push: |
| 8 | + tags: |
| 9 | + - '*.*.*' |
| 10 | + |
| 11 | +jobs: |
| 12 | + |
| 13 | + cfr: |
| 14 | + name: "CFR for OS ${{ matrix.os }}" |
| 15 | + |
| 16 | + runs-on: ${{ matrix.os }} |
| 17 | + strategy: |
| 18 | + fail-fast: false |
| 19 | + matrix: |
| 20 | + os: [ |
| 21 | + "macos-13", # Intel |
| 22 | + "macos-latest", # ARM |
| 23 | + "ubuntu-latest", # Intel |
| 24 | + "windows-latest", # Intel |
| 25 | + ] |
| 26 | + |
| 27 | + steps: |
| 28 | + |
| 29 | + - name: Acquire sources |
| 30 | + uses: actions/checkout@v4 |
| 31 | + |
| 32 | + - name: Set up Python |
| 33 | + uses: actions/setup-python@v5 |
| 34 | + with: |
| 35 | + python-version: '3.12' |
| 36 | + cache: 'pip' |
| 37 | + cache-dependency-path: 'pyproject.toml' |
| 38 | + |
| 39 | + - name: Set up project |
| 40 | + run: pip install --use-pep517 --prefer-binary --editable='.[cfr,release-cfr]' |
| 41 | + |
| 42 | + - name: Build application bundle |
| 43 | + run: poe build-cfr |
| 44 | + |
| 45 | + - name: Compute artifact suffix (OS-ARCH) |
| 46 | + id: artifact-suffix |
| 47 | + uses: ASzc/change-string-case-action@v6 |
| 48 | + with: |
| 49 | + string: "${{ runner.os }}-${{ runner.arch }}" |
| 50 | + |
| 51 | + - name: Upload artifact for Linux and macOS |
| 52 | + if: runner.os != 'Windows' |
| 53 | + uses: actions/upload-artifact@v4 |
| 54 | + with: |
| 55 | + name: "cratedb-cfr-${{ steps.artifact-suffix.outputs.lowercase }}" |
| 56 | + path: dist/cratedb-cfr |
| 57 | + |
| 58 | + - name: Upload artifact for Windows |
| 59 | + if: runner.os == 'Windows' |
| 60 | + uses: actions/upload-artifact@v4 |
| 61 | + with: |
| 62 | + name: "cratedb-cfr-${{ steps.artifact-suffix.outputs.lowercase }}" |
| 63 | + path: dist/cratedb-cfr.exe |
| 64 | + |
| 65 | + # TODO: Upload to release assets or GitHub Pages, when invoked on "tag" event. |
| 66 | + #if: startsWith(github.event.ref, 'refs/tags') |
0 commit comments