|
| 1 | +name: Build and Deploy Snapshot |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - main |
| 6 | +concurrency: |
| 7 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + if: ${{ github.repository == 'spring-gradle-plugins/dependency-management-plugin' }} |
| 11 | + name: Build and Deploy Snapshot |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - name: Set up Java |
| 15 | + uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 |
| 16 | + with: |
| 17 | + distribution: 'liberica' |
| 18 | + java-version: 17 |
| 19 | + - name: Check Out Code |
| 20 | + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 21 | + - name: Set Up Gradle |
| 22 | + uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 |
| 23 | + - name: Configure Gradle Properties |
| 24 | + shell: bash |
| 25 | + run: | |
| 26 | + mkdir -p $HOME/.gradle |
| 27 | + echo 'systemProp.user.name=spring-builds+github' >> $HOME/.gradle/gradle.properties |
| 28 | + echo 'systemProp.org.gradle.internal.launcher.welcomeMessageEnabled=false' >> $HOME/.gradle/gradle.properties |
| 29 | + echo 'org.gradle.daemon=false' >> $HOME/.gradle/gradle.properties |
| 30 | + - name: Build and Publish |
| 31 | + env: |
| 32 | + GRADLE_ENTERPRISE_URL: 'https://ge.spring.io' |
| 33 | + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }} |
| 34 | + GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }} |
| 35 | + GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }} |
| 36 | + run: ./gradlew -PdeploymentRepository=$(pwd)/distribution-repository build publishAllPublicationsToDeploymentRepository |
| 37 | + - name: Deploy |
| 38 | + uses: spring-io/artifactory-deploy-action@26bbe925a75f4f863e1e529e85be2d0093cac116 # v0.0.1 |
| 39 | + with: |
| 40 | + uri: 'https://repo.spring.io' |
| 41 | + username: ${{ secrets.ARTIFACTORY_USERNAME }} |
| 42 | + password: ${{ secrets.ARTIFACTORY_PASSWORD }} |
| 43 | + build-name: spring-restdocs |
| 44 | + repository: 'libs-snapshot-local' |
| 45 | + folder: 'deployment-repository' |
| 46 | + signing-key: ${{ secrets.GPG_PRIVATE_KEY }} |
| 47 | + signing-passphrase: ${{ secrets.GPG_PASSPHRASE }} |
| 48 | + artifact-properties: | |
| 49 | + /**/spring-restdocs-*.zip::zip.type=docs,zip.deployed=false |
0 commit comments