Skip to content

Commit

Permalink
CFR: Publish self-contained application bundle to GH Workflow Artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Jul 8, 2024
1 parent 58c2bf2 commit 488a2a2
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/release-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Stage PyInstaller application bundles through GitHub Actions (GHA) to GitHub Workflow Artifacts.
# https://github.com/actions/upload-artifact#where-does-the-upload-go

name: "Release: Application Bundle"

on:
pull_request: ~
push:
tags:
- '*'

jobs:

cfr:
name: "CFR for OS ${{ matrix.os }}"

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [
"macos-13", # Intel
"macos-latest", # ARM
"ubuntu-latest", # Intel
"windows-latest", # Intel
]
# TODO: Also build for Linux/ARM, because this platform gets more traction in datacenters.
# - https://github.blog/changelog/2024-06-03-actions-arm-based-linux-and-windows-runners-are-now-in-public-beta/
# - https://arm-software.github.io/AVH/main/infrastructure/html/avh_gh.html
# - via: https://github.com/actions/partner-runner-images

steps:

- name: Acquire sources
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
cache-dependency-path: 'pyproject.toml'

- name: Set up project
run: pip install --use-pep517 --prefer-binary --editable='.[cfr,release-cfr]'

- name: Build application bundle
run: poe build-cfr

- name: Compute artifact suffix (OS-ARCH)
id: artifact-suffix
uses: ASzc/change-string-case-action@v6
with:
string: "${{ runner.os }}-${{ runner.arch }}"

- name: Upload artifact to Workflow Artifacts (Linux and macOS)
if: runner.os != 'Windows'
uses: actions/upload-artifact@v4
with:
name: "cratedb-cfr-${{ steps.artifact-suffix.outputs.lowercase }}"
path: dist/cratedb-cfr

- name: Upload artifact to Workflow Artifacts (Windows)
if: runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: "cratedb-cfr-${{ steps.artifact-suffix.outputs.lowercase }}"
path: dist/cratedb-cfr.exe

- name: Upload artifact to release assets
if: startsWith(github.event.ref, 'refs/tags')
run: echo "Not implemented yet."
# TODO: Upload to release assets, when invoked on "tag" event.
# https://github.com/grafana-toolbox/grafana-client/blob/4.1.0/.github/workflows/release.yml#L27-L42
# https://github.com/marketplace/actions/create-release
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- SQLAlchemy: Clean up and refactor SQLAlchemy polyfills
to `cratedb_toolkit.util.sqlalchemy`
- CFR: Build as a self-contained program using PyInstaller
- CFR: Publish self-contained application bundle to GitHub Workflow Artifacts

## 2024/06/18 v0.0.14
- Add `ctk cfr` and `ctk wtf` diagnostics programs
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ release = [
"twine<6",
]
release-cfr = [
"poethepoet<0.28",
"pyinstaller<7",
]
service = [
Expand Down

0 comments on commit 488a2a2

Please sign in to comment.