Skip to content

Commit c79b83b

Browse files
vsridharan-bznbehrens-bz
authored andcommitted
Configure github actions to allow releasing from a feature branch
1 parent 897f028 commit c79b83b

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed
Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ on:
88
pull_request:
99
branches:
1010
- master
11+
- api-v2
12+
- 7.x # TODO: This is temporary and will be removed once we merge this branch to master branch
1113

1214
env:
13-
PYTHON_DEFAULT_VERSION: 3.8
1415
OUTPUT_DIR: $GITHUB_WORKSPACE/build/outputs
1516
OUTPUT_ZIP: b2-sdk-build-${GITHUB_RUN_NUMBER}.zip
1617
BUILD_NUMBER: ${{ github.run_number }}
@@ -21,7 +22,7 @@ env:
2122

2223
jobs:
2324
build:
24-
runs-on: ubuntu-latest
25+
runs-on: self-hosted
2526
steps:
2627
- uses: actions/checkout@v4
2728
with:
@@ -36,16 +37,14 @@ jobs:
3637
- name: Setup Gradle
3738
uses: gradle/actions/setup-gradle@v4
3839

39-
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }}
40-
uses: actions/setup-python@v5
41-
with:
42-
python-version: ${{ env.PYTHON_DEFAULT_VERSION }}
43-
44-
- name: Install dependencies
40+
- name: Set up Python
4541
run: |
42+
python3.8 -m venv env
43+
source env/bin/activate
44+
echo "VIRTUAL ENV:" $VIRTUAL_ENV
4645
# upgrade pip and setuptools so that b2 CLI can be properly installed
47-
python -m pip install --upgrade pip setuptools
48-
python -m pip install b2
46+
pip install --upgrade pip setuptools
47+
pip install b2 pysqlite3
4948
5049
- name: Build the distribution
5150
run: |
@@ -63,7 +62,7 @@ jobs:
6362
zip -r $GITHUB_WORKSPACE/build/${{ env.OUTPUT_ZIP }} *
6463
6564
- name: Deploy to internal Maven repo
66-
if: github.ref == 'refs/heads/master' && github.repository == 'Backblaze/b2-sdk-java-private'
65+
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/api-v2' || github.ref == 'refs/heads/7.x') && github.repository == 'Backblaze/b2-sdk-java-private'
6766
run: $GITHUB_WORKSPACE/gradlew publishMavenPublicationToBzArtifactoryRepository publishMavenPublicationToBzGithubPackagesRepository
6867
env:
6968
ORG_GRADLE_PROJECT_bzArtifactoryUsername: ${{ secrets.ARTIFACTORY_USERNAME }}
@@ -72,10 +71,12 @@ jobs:
7271
ORG_GRADLE_PROJECT_bzGithubPackagesPassword: ${{ secrets.PACKAGES_TOKEN }}
7372

7473
- name: Upload to b2
75-
if: github.ref == 'refs/heads/master'
74+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/api-v2' || github.ref == 'refs/heads/7.x'
7675
# upload to b2 (if credentials are provided, as they will be for backblaze's builds, but not pull requests)
77-
# This should be using python 3.4
78-
run: $GITHUB_WORKSPACE/maybe_upload_build_results ${{ env.OUTPUT_ZIP }}
76+
# This should be using python 3.8
77+
run: |
78+
source $GITHUB_WORKSPACE/env/bin/activate
79+
$GITHUB_WORKSPACE/maybe_upload_build_results ${{ env.OUTPUT_ZIP }}
7980
8081
- name: Check GitHub Pages status
8182
if: github.ref == 'refs/heads/master'
@@ -87,7 +88,7 @@ jobs:
8788
# note that i'm only uploading the javadocs for b2-sdk-core.
8889
# that's because i'm lame and building separate javadocs for
8990
# each jar and only uploading one set of javadocs.
90-
if: github.ref == 'refs/heads/master' && success()
91+
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/api-v2' || github.ref == 'refs/heads/7.x') && success()
9192
uses: crazy-max/ghaction-github-pages@v3
9293
with:
9394
target_branch: gh-pages

0 commit comments

Comments
 (0)