-
Notifications
You must be signed in to change notification settings - Fork 4
84 lines (68 loc) · 2.77 KB
/
release-app.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# 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: |
# `setuptools 64` adds support for editable install hooks (PEP 660).
# https://github.com/pypa/setuptools/blob/main/CHANGES.rst#v6400
# `setuptools 71` significantly re-vendors setuptools packages, causing hiccups on Python 3.8.
# https://github.com/pypa/setuptools/pull/4457
pip install "setuptools>=64,<71" --upgrade
# Install package in editable mode.
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