|
23 | 23 | jobs: |
24 | 24 | build: |
25 | 25 | runs-on: ${{ github.repository == 'Backblaze/b2-sdk-java-private' && 'self-hosted'|| 'ubuntu-latest' }} |
| 26 | + |
26 | 27 | steps: |
27 | 28 | - uses: actions/checkout@v4 |
28 | 29 | with: |
29 | 30 | fetch-depth: 0 |
30 | 31 |
|
31 | 32 | - uses: actions/setup-java@v4 |
32 | 33 | with: |
33 | | - distribution: 'temurin' |
| 34 | + distribution: temurin |
34 | 35 | java-version: '11' |
35 | 36 |
|
36 | 37 | - uses: gradle/actions/wrapper-validation@v4 |
37 | 38 | - name: Setup Gradle |
38 | 39 | uses: gradle/actions/setup-gradle@v4 |
39 | 40 |
|
40 | | - - name: Set up Python |
| 41 | + # --- uv + Python 3.13, then create a venv in $RUNNER_TEMP --- |
| 42 | + - name: Set up uv |
| 43 | + uses: astral-sh/setup-uv@v5 |
| 44 | + with: |
| 45 | + enable-cache: false |
| 46 | + |
| 47 | + - name: Install Python 3.13 and create venv |
| 48 | + shell: bash |
41 | 49 | 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 |
| 50 | + set -euxo pipefail |
| 51 | + uv python install 3.13 |
| 52 | + # Create a throwaway venv for this job |
| 53 | + UV_VENV="$RUNNER_TEMP/py313" |
| 54 | + uv venv "$UV_VENV" |
| 55 | + echo "UV_VENV=$UV_VENV" >> "$GITHUB_ENV" |
| 56 | + # Prove it's 3.13 |
| 57 | + "$UV_VENV/bin/python" --version |
| 58 | +
|
| 59 | + - name: Install Python deps into venv (uv) |
| 60 | + shell: bash |
| 61 | + run: | |
| 62 | + uv pip install --python "$UV_VENV/bin/python" --upgrade pip setuptools wheel |
| 63 | + uv pip install --python "$UV_VENV/bin/python" b2 pysqlite3-binary |
48 | 64 |
|
49 | 65 | - name: Build the distribution |
50 | 66 | run: | |
51 | 67 | $GITHUB_WORKSPACE/gradlew build |
52 | | - # |
53 | | - # Prepare the outputs |
54 | | - # |
55 | | -
|
56 | | - # make the directory |
57 | 68 | mkdir -p ${{ env.OUTPUT_DIR }} |
58 | 69 | cp -v */build/libs/b2-sdk-*.{jar,pom,module} ${{ env.OUTPUT_DIR }} |
59 | | -
|
60 | | - # zip up the outputs |
61 | 70 | cd ${{ env.OUTPUT_DIR }} |
62 | 71 | zip -r $GITHUB_WORKSPACE/build/${{ env.OUTPUT_ZIP }} * |
63 | 72 |
|
|
79 | 88 |
|
80 | 89 | - name: Upload to b2 |
81 | 90 | 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 |
84 | 91 | run: | |
85 | | - source $GITHUB_WORKSPACE/env/bin/activate |
86 | | - $GITHUB_WORKSPACE/maybe_upload_build_results ${{ env.OUTPUT_ZIP }} |
| 92 | + export PATH="$UV_VENV/bin:$PATH" |
| 93 | + "$GITHUB_WORKSPACE/maybe_upload_build_results" "${{ env.OUTPUT_ZIP }}" |
87 | 94 |
|
88 | 95 | - name: Check GitHub Pages status |
89 | 96 | if: github.ref == 'refs/heads/master' |
|
92 | 99 | pages_threshold: major_outage |
93 | 100 |
|
94 | 101 | - 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. |
98 | 102 | if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/api-v2' || github.ref == 'refs/heads/7.x') && success() |
99 | 103 | uses: crazy-max/ghaction-github-pages@v3 |
100 | 104 | with: |
|
0 commit comments