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
1214env :
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 }}
17- # This token was generated under rhryckewicz account
18- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
1918 # These are stored in Bitwarden
2019 B2_ACCOUNT_ID : ${{ secrets.B2_ACCOUNT_ID }}
2120 B2_UPLOAD_BUCKET : ${{ secrets.B2_UPLOAD_BUCKET }}
2221 B2_APPLICATION_KEY : ${{ secrets.B2_APPLICATION_KEY }}
2322
2423jobs :
2524 build :
26- runs-on : ubuntu-latest
25+ runs-on : self-hosted
2726 steps :
28- - uses : actions/checkout@v2
27+ - uses : actions/checkout@v4
2928 with :
3029 fetch-depth : 0
3130
32- - name : Use jdk8
33- uses : actions/setup-java@v2
31+ - uses : actions/setup-java@v4
3432 with :
35- distribution : ' adopt'
36- java-version : ' 8'
37- cache : ' gradle'
33+ distribution : ' temurin'
34+ java-version : ' 11'
3835
39- - uses : gradle/wrapper-validation-action@v1
40- - name : Set up Python ${{ env.PYTHON_DEFAULT_VERSION }}
41- uses : actions/setup-python@v2
42- with :
43- python-version : ${{ env.PYTHON_DEFAULT_VERSION }}
36+ - uses : gradle/actions/wrapper-validation@v4
37+ - name : Setup Gradle
38+ uses : gradle/actions/setup-gradle@v4
4439
45- - name : Install dependencies
40+ - name : Set up Python
4641 run : |
47- mkdir -p ~/.gradle && echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties
42+ python3.8 -m venv env
43+ source env/bin/activate
44+ echo "VIRTUAL ENV:" $VIRTUAL_ENV
4845 # upgrade pip and setuptools so that b2 CLI can be properly installed
49- python -m pip install --upgrade pip setuptools
50- python -m pip install b2
46+ pip install --upgrade pip setuptools
47+ pip install b2 pysqlite3
5148
5249 - name : Build the distribution
5350 run : |
@@ -65,37 +62,34 @@ jobs:
6562 zip -r $GITHUB_WORKSPACE/build/${{ env.OUTPUT_ZIP }} *
6663
6764 - name : Deploy to internal Maven repo
68- if : github.ref == 'refs/heads/master' && github.repository == 'Backblaze/b2-sdk-java-private'
69- run : $GITHUB_WORKSPACE/gradlew publishMavenPublicationToBzGithubPackagesRepository
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'
66+ run : $GITHUB_WORKSPACE/gradlew publishMavenPublicationToBzArtifactoryRepository publishMavenPublicationToBzGithubPackagesRepository
7067 env :
68+ ORG_GRADLE_PROJECT_bzArtifactoryUsername : ${{ secrets.ARTIFACTORY_USERNAME }}
69+ ORG_GRADLE_PROJECT_bzArtifactoryPassword : ${{ secrets.ARTIFACTORY_TOKEN }}
7170 ORG_GRADLE_PROJECT_bzGithubPackagesUsername : ${{ secrets.PACKAGES_USERNAME }}
7271 ORG_GRADLE_PROJECT_bzGithubPackagesPassword : ${{ secrets.PACKAGES_TOKEN }}
7372
74- - name : Cleanup Gradle Cache
75- # Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
76- # Restoring these files from a GitHub Actions cache might cause problems for future builds.
77- run : |
78- rm -f ~/.gradle/caches/modules-2/modules-2.lock
79- rm -fr ~/.gradle/caches/*/plugin-resolution/
80-
8173 - name : Upload to b2
82- 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'
8375 # upload to b2 (if credentials are provided, as they will be for backblaze's builds, but not pull requests)
84- # This should be using python 3.4
85- 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 }}
8680
8781 - name : Check GitHub Pages status
8882 if : github.ref == 'refs/heads/master'
89- uses : crazy-max/ghaction-github-status@v2
83+ uses : crazy-max/ghaction-github-status@v4
9084 with :
9185 pages_threshold : major_outage
9286
93- - name : Deploy
87+ - name : Deploy Javadoc
9488 # note that i'm only uploading the javadocs for b2-sdk-core.
9589 # that's because i'm lame and building separate javadocs for
9690 # each jar and only uploading one set of javadocs.
97- if : github.ref == 'refs/heads/master' && success()
98- uses : crazy-max/ghaction-github-pages@v2
91+ if : ( github.ref == 'refs/heads/master' || github.ref == 'refs/heads/api-v2' || github.ref == 'refs/heads/7.x') && success()
92+ uses : crazy-max/ghaction-github-pages@v3
9993 with :
10094 target_branch : gh-pages
10195 build_dir : core/build/docs/javadoc
0 commit comments