-
Notifications
You must be signed in to change notification settings - Fork 649
82 lines (69 loc) · 2.51 KB
/
pre-release.yml
File metadata and controls
82 lines (69 loc) · 2.51 KB
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
name: Pre-Release Preswald
on:
workflow_dispatch:
inputs:
run_tests:
description: "Run tests"
required: true
default: true
type: boolean
jobs:
pre-release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build setuptools wheel twine
pip install -e .
- name: Install bc for version calculations
run: sudo apt-get install -y bc zip
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1
with:
install_components: "gsutil"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Conda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: "3.12"
- name: Run pre-release process
run: |
if [ "${{ inputs.run_tests }}" == "true" ]; then
make pre-release
else
# Skip tests by running individual targets
make update-version build-frontend build-wheel build-docker upload-to-gcs upload-static-to-gcs
fi
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
PRESWALD_DEPLOYER_DEV_SA: ${{ secrets.PRESWALD_DEPLOYER_DEV_SA }}
- name: Upload wheel as artifact
uses: actions/upload-artifact@v4
with:
name: preswald-wheel
path: dist/*.whl
if-no-files-found: error
- name: Get version info
id: get_version
run: echo "VERSION=$(grep 'version' pyproject.toml | grep -v '^#' | head -1 | sed -E 's/.*version = "([^"]+)".*/\1/')" >> $GITHUB_OUTPUT
- name: Summary
run: |
echo "## Pre-release Summary" >> $GITHUB_STEP_SUMMARY
echo "- Version: ${{ steps.get_version.outputs.VERSION }}" >> $GITHUB_STEP_SUMMARY
echo "- Wheel: $(ls -t dist/preswald-*.whl | head -1)" >> $GITHUB_STEP_SUMMARY
echo "- Docker Image: structuredlabs/preswald:latest" >> $GITHUB_STEP_SUMMARY