Bump actions/checkout from 4.1.6 to 4.1.7 (#285) #135
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Expected secrets | |
# MAVEN_CENTRAL_USERNAME - Username for Maven Central | |
# MAVEN_CENTRAL_PASSWORD - Password for Maven Central | |
# Note that snapshot releases do not require GPG signing | |
name: Deploy Snapshot | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '.github/ISSUE_TEMPLATE/*' | |
- '.github/PULL_REQUEST_TEMPLATE.md' | |
- 'LICENSE' | |
- 'README.md' | |
- 'docs/**' | |
concurrency: deploy_snapshot | |
jobs: | |
validate_gradle_wrapper: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout | |
timeout-minutes: 1 | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
# Gradle Wrapper validation can be flaky | |
# https://github.com/gradle/wrapper-validation-action/issues/40 | |
- name: Gradle Wrapper Validation | |
timeout-minutes: 1 | |
uses: gradle/wrapper-validation-action@216d1ad2b3710bf005dc39237337b9673fd8fcd5 | |
check_secrets: | |
environment: deployment | |
permissions: | |
contents: read | |
runs-on: ubuntu-latest | |
outputs: | |
has-secrets: ${{ steps.check_secrets.outputs.defined }} | |
steps: | |
- id: check_secrets | |
env: | |
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | |
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | |
if: "${{ env.MAVEN_CENTRAL_USERNAME != '' && env.MAVEN_CENTRAL_PASSWORD != '' }}" | |
run: echo "::set-output name=defined::true" | |
deploy_snapshot: | |
if: needs.check_secrets.outputs.has-secrets == 'true' | |
needs: [validate_gradle_wrapper, check_secrets] | |
environment: deployment | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout | |
timeout-minutes: 1 | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
- name: Set up Java | |
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 | |
timeout-minutes: 1 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- name: Set up Gradle | |
uses: gradle/gradle-build-action@4c39dd82cd5e1ec7c6fa0173bb41b4b6bb3b86ff | |
timeout-minutes: 10 | |
with: | |
gradle-home-cache-cleanup: true | |
# While not strictly necessary, this sanity checks the build before attempting to upload. | |
# This adds minimal additional build time, since most of the work is cached and re-used | |
# in the next step. | |
- name: Deploy to Maven Local | |
timeout-minutes: 25 | |
env: | |
ORG_GRADLE_PROJECT_IS_SNAPSHOT: true | |
run: | | |
./gradlew publishAllPublicationsToMavenLocalRepository --no-parallel | |
- name: Deploy to Maven Central | |
timeout-minutes: 5 | |
env: | |
ORG_GRADLE_PROJECT_ZCASH_MAVEN_PUBLISH_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | |
ORG_GRADLE_PROJECT_ZCASH_MAVEN_PUBLISH_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | |
ORG_GRADLE_PROJECT_IS_SNAPSHOT: true | |
run: | | |
./gradlew publishAllPublicationsToMavenCentralRepository --no-parallel | |
- name: Collect Artifacts | |
timeout-minutes: 1 | |
if: ${{ always() }} | |
run: | | |
export ARTIFACTS_DIR_PATH=~/artifacts | |
export BINARIES_ZIP_PATH=${ARTIFACTS_DIR_PATH}/snapshot_binaries.zip | |
mkdir ${ARTIFACTS_DIR_PATH} | |
zip -r ${BINARIES_ZIP_PATH} . -i *build/libs/* | |
- name: Upload Artifacts | |
if: ${{ always() }} | |
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 | |
timeout-minutes: 1 | |
with: | |
name: Snapshot binaries | |
path: ~/artifacts |