|
| 1 | +name: Retry Release |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + inputs: |
| 5 | + gorm_version: |
| 6 | + description: 'Gorm Version (eg: 7.0.8)' |
| 7 | + required: true |
| 8 | +jobs: |
| 9 | + release: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + java: ['11'] |
| 14 | + env: |
| 15 | + BETA: ${{ contains(github.event.inputs.gorm_version, 'M') || contains(github.event.inputs.gorm_version, 'RC') }} |
| 16 | + GIT_USER_NAME: puneetbehl |
| 17 | + |
| 18 | + steps: |
| 19 | + - name: Checkout repository |
| 20 | + uses: actions/checkout@v3 |
| 21 | + with: |
| 22 | + ref: v${{ github.event.inputs.gorm_version }} |
| 23 | + token: ${{ secrets.GH_TOKEN }} |
| 24 | + - uses: gradle/wrapper-validation-action@v1 |
| 25 | + - name: Set up JDK |
| 26 | + uses: actions/setup-java@v1 |
| 27 | + with: |
| 28 | + java-version: ${{ matrix.java }} |
| 29 | + - name: Extract branch name |
| 30 | + if: success() && github.event_name == 'workflow_dispatch' |
| 31 | + id: extract_branch |
| 32 | + run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT |
| 33 | + - name: Asset Path |
| 34 | + if: success() && github.event_name == 'workflow_dispatch' |
| 35 | + id: asset_path |
| 36 | + uses: haya14busa/action-cond@v1 |
| 37 | + with: |
| 38 | + cond: ${{ env.BETA == '' || env.BETA == 'false' }} |
| 39 | + if_true: ${{ env.PATH_PREFIX }}-${{ github.event.inputs.gorm_version }}.zip |
| 40 | + if_false: ${{ env.PATH_PREFIX }}-${{ github.event.inputs.gorm_version }}.zip |
| 41 | + env: |
| 42 | + PATH_PREFIX: "./build/distributions/gorm-docs" |
| 43 | + - name: Create Release |
| 44 | + if: success() && github.event_name == 'workflow_dispatch' |
| 45 | + id: create_release |
| 46 | + uses: actions/create-release@v1 |
| 47 | + env: |
| 48 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 49 | + with: |
| 50 | + tag_name: v${{ github.event.inputs.gorm_version }} |
| 51 | + release_name: ${{ github.event.inputs.gorm_version }} |
| 52 | + draft: false |
| 53 | + prerelease: ${{ env.BETA }} |
| 54 | + - name: Publish Documentation |
| 55 | + uses: gradle/gradle-build-action@v2 |
| 56 | + with: |
| 57 | + arguments: asciidoctor groovydoc docs assemble |
| 58 | + env: |
| 59 | + TAGGED_VERSION: v${{ github.event.inputs.gorm_version }} |
| 60 | + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} |
| 61 | + GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }} |
| 62 | + GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }} |
| 63 | + - name: Upload Release Asset |
| 64 | + if: success() && github.event_name == 'workflow_dispatch' |
| 65 | + id: upload-release-asset |
| 66 | + uses: actions/upload-release-asset@v1 |
| 67 | + env: |
| 68 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 69 | + with: |
| 70 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 71 | + asset_path: ${{ steps.asset_path.outputs.value }} |
| 72 | + asset_name: gorm-docs.zip |
| 73 | + asset_content_type: application/zip |
| 74 | + - name: Determine docs target repository |
| 75 | + if: success() |
| 76 | + uses: haya14busa/action-cond@v1 |
| 77 | + id: docs_target |
| 78 | + with: |
| 79 | + cond: ${{ github.repository == 'grails/gorm-docs' }} |
| 80 | + if_true: 'grails/grails-data-mapping' |
| 81 | + if_false: ${{ github.repository }} |
| 82 | + - name: Publish to Github Pages |
| 83 | + if: success() |
| 84 | + uses: grails/github-pages-deploy-action@main |
| 85 | + env: |
| 86 | + TARGET_REPOSITORY: ${{ steps.docs_target.outputs.value }} |
| 87 | + GH_TOKEN: ${{ secrets.GH_TOKEN }} |
| 88 | + BRANCH: gh-pages |
| 89 | + FOLDER: build/docs |
| 90 | + VERSION: ${{ github.event.inputs.gorm_version }} |
| 91 | + DOC_FOLDER: gh-pages |
| 92 | + COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }} |
| 93 | + COMMIT_NAME: ${{ env.GIT_USER_NAME }} |
0 commit comments