Skip to content

Commit 435975c

Browse files
tlucas30Copilot
andauthored
Updating python (#112)
* test * 3.x * test * testing uv * "system" * poke * test * testerton * Cleaning up. * Update .github/workflows/ci_cd.yml Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent c6786a0 commit 435975c

File tree

1 file changed

+31
-29
lines changed

1 file changed

+31
-29
lines changed

.github/workflows/ci_cd.yml

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,57 +7,64 @@ on:
77
push:
88
pull_request:
99
branches:
10-
- master
11-
- api-v2
12-
- 7.x # TODO: This is temporary and will be removed once we merge this branch to master branch
10+
- master
11+
- api-v2
12+
- 7.x
1313

1414
env:
1515
OUTPUT_DIR: $GITHUB_WORKSPACE/build/outputs
1616
OUTPUT_ZIP: b2-sdk-build-${GITHUB_RUN_NUMBER}.zip
1717
BUILD_NUMBER: ${{ github.run_number }}
18-
# These are stored in Bitwarden
1918
B2_ACCOUNT_ID: ${{ secrets.B2_ACCOUNT_ID }}
2019
B2_UPLOAD_BUCKET: ${{ secrets.B2_UPLOAD_BUCKET }}
2120
B2_APPLICATION_KEY: ${{ secrets.B2_APPLICATION_KEY }}
2221

2322
jobs:
2423
build:
25-
runs-on: ${{ github.repository == 'Backblaze/b2-sdk-java-private' && 'self-hosted'|| 'ubuntu-latest' }}
24+
runs-on: ${{ github.repository == 'Backblaze/b2-sdk-java-private' && 'self-hosted' || 'ubuntu-latest' }}
25+
2626
steps:
2727
- uses: actions/checkout@v4
2828
with:
2929
fetch-depth: 0
3030

3131
- uses: actions/setup-java@v4
3232
with:
33-
distribution: 'temurin'
33+
distribution: temurin
3434
java-version: '11'
3535

3636
- uses: gradle/actions/wrapper-validation@v4
37-
- name: Setup Gradle
38-
uses: gradle/actions/setup-gradle@v4
37+
- uses: gradle/actions/setup-gradle@v4
38+
39+
# --- uv + Python 3.13, then create a venv in $RUNNER_TEMP ---
40+
- name: Set up uv
41+
uses: astral-sh/setup-uv@v5
42+
with:
43+
enable-cache: false
3944

40-
- name: Set up Python
45+
- name: Install Python 3.13 and create venv
46+
shell: bash
4147
run: |
42-
python3.8 -m venv env
43-
source env/bin/activate
44-
echo "VIRTUAL ENV:" $VIRTUAL_ENV
45-
# upgrade pip and setuptools so that b2 CLI can be properly installed
46-
pip install --upgrade pip setuptools
47-
pip install b2 pysqlite3
48+
set -euxo pipefail
49+
uv python install 3.13
50+
# Create a throwaway venv for this job
51+
UV_VENV="$RUNNER_TEMP/py313"
52+
uv venv "$UV_VENV"
53+
echo "UV_VENV=$UV_VENV" >> "$GITHUB_ENV"
54+
# Prove it's 3.13
55+
"$UV_VENV/bin/python" --version
56+
57+
- name: Install Python deps into venv (uv)
58+
shell: bash
59+
run: |
60+
uv pip install --python "$UV_VENV/bin/python" --upgrade pip setuptools wheel
61+
uv pip install --python "$UV_VENV/bin/python" b2 pysqlite3-binary
4862
4963
- name: Build the distribution
5064
run: |
5165
$GITHUB_WORKSPACE/gradlew build
52-
#
53-
# Prepare the outputs
54-
#
55-
56-
# make the directory
5766
mkdir -p ${{ env.OUTPUT_DIR }}
5867
cp -v */build/libs/b2-sdk-*.{jar,pom,module} ${{ env.OUTPUT_DIR }}
59-
60-
# zip up the outputs
6168
cd ${{ env.OUTPUT_DIR }}
6269
zip -r $GITHUB_WORKSPACE/build/${{ env.OUTPUT_ZIP }} *
6370
@@ -79,11 +86,9 @@ jobs:
7986

8087
- name: Upload to b2
8188
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/api-v2' || github.ref == 'refs/heads/7.x'
82-
# upload to b2 (if credentials are provided, as they will be for backblaze's builds, but not pull requests)
83-
# This should be using python 3.8
8489
run: |
85-
source $GITHUB_WORKSPACE/env/bin/activate
86-
$GITHUB_WORKSPACE/maybe_upload_build_results ${{ env.OUTPUT_ZIP }}
90+
export PATH="$UV_VENV/bin:$PATH"
91+
"$GITHUB_WORKSPACE/maybe_upload_build_results" "${{ env.OUTPUT_ZIP }}"
8792
8893
- name: Check GitHub Pages status
8994
if: github.ref == 'refs/heads/master'
@@ -92,9 +97,6 @@ jobs:
9297
pages_threshold: major_outage
9398

9499
- name: Deploy Javadoc
95-
# note that i'm only uploading the javadocs for b2-sdk-core.
96-
# that's because i'm lame and building separate javadocs for
97-
# each jar and only uploading one set of javadocs.
98100
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/api-v2' || github.ref == 'refs/heads/7.x') && success()
99101
uses: crazy-max/ghaction-github-pages@v3
100102
with:

0 commit comments

Comments
 (0)