|
| 1 | +name: Release minor ~ Full workflow |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + |
| 5 | +jobs: |
| 6 | + gate-approval: |
| 7 | + runs-on: ubuntu-latest |
| 8 | + environment: |
| 9 | + name: production |
| 10 | + steps: |
| 11 | + - run: echo "Initiating approval" |
| 12 | + |
| 13 | + get-version: |
| 14 | + needs: gate-approval |
| 15 | + runs-on: |
| 16 | + group: infra1-runners-arc |
| 17 | + labels: runners-small |
| 18 | + outputs: |
| 19 | + version: ${{ steps.version.outputs.version }} |
| 20 | + branch: ${{ steps.branch.outputs.branch }} |
| 21 | + steps: |
| 22 | + - name: Checkout code |
| 23 | + uses: actions/checkout@v4 |
| 24 | + with: |
| 25 | + ref: 'master' |
| 26 | + token: ${{ secrets.TOKEN_GITHUB_YENKINS_ADMIN }} |
| 27 | + - name: Setup node |
| 28 | + uses: ./.github/actions/node/set-up-node |
| 29 | + id: node-init |
| 30 | + - name: Get version |
| 31 | + uses: gooddata/gooddata-ui-sdk/.github/actions/get-version-action@master |
| 32 | + id: version |
| 33 | + - name: Get branch |
| 34 | + run: | |
| 35 | + BRANCH=$(echo $VERSION | sed 's/^\([0-9]*\.[0-9]*\).*/\1/') |
| 36 | + REL_BRANCH="rel/$BRANCH" |
| 37 | + echo "preparing branch $REL_BRANCH for version $VERSION" |
| 38 | + echo "branch=$REL_BRANCH" >> $GITHUB_OUTPUT |
| 39 | + env: |
| 40 | + VERSION: ${{ steps.version.outputs.version }} |
| 41 | + id: branch |
| 42 | + |
| 43 | + # PREPARE REL BRANCH |
| 44 | + |
| 45 | + prepare-branch: |
| 46 | + needs: get-version |
| 47 | + runs-on: [ubuntu-latest] |
| 48 | + permissions: |
| 49 | + contents: write |
| 50 | + |
| 51 | + steps: |
| 52 | + - name: Run copy branch action |
| 53 | + uses: gooddata/gooddata-ui-sdk/.github/actions/branch-cutoff-action@master |
| 54 | + with: |
| 55 | + source-branch: 'master' |
| 56 | + target-branch: ${{ needs.get-version.outputs.branch }} |
| 57 | + token: ${{ secrets.TOKEN_GITHUB_YENKINS_ADMIN }} |
| 58 | + |
| 59 | + prepare-versions-release: |
| 60 | + needs: [get-version, prepare-branch] |
| 61 | + uses: ./.github/workflows/rw-bump-version.yml |
| 62 | + secrets: inherit |
| 63 | + permissions: |
| 64 | + contents: write |
| 65 | + with: |
| 66 | + source-branch: ${{ needs.get-version.outputs.branch }} |
| 67 | + bump: 'prerelease' |
| 68 | + prerelease-id: 'beta' |
| 69 | + |
| 70 | + prepare-versions-master: |
| 71 | + needs: [get-version, prepare-branch] |
| 72 | + uses: ./.github/workflows/rw-bump-version.yml |
| 73 | + secrets: inherit |
| 74 | + permissions: |
| 75 | + contents: write |
| 76 | + with: |
| 77 | + source-branch: 'master' |
| 78 | + bump: 'preminor' |
| 79 | + prerelease-id: 'alpha' |
| 80 | + |
| 81 | + # RELEASE |
| 82 | + |
| 83 | + publish-release: |
| 84 | + needs: [prepare-versions-release, prepare-versions-master, get-version] |
| 85 | + uses: ./.github/workflows/rw-publish-release.yml |
| 86 | + permissions: |
| 87 | + contents: write |
| 88 | + id-token: write |
| 89 | + secrets: inherit |
| 90 | + with: |
| 91 | + bump: 'minor' |
| 92 | + source-branch: ${{ needs.get-version.outputs.branch }} |
| 93 | + |
| 94 | + update-hugo-version: |
| 95 | + needs: [publish-release, get-version] |
| 96 | + uses: ./.github/workflows/rw-doc-update-hugo-version.yml |
| 97 | + permissions: |
| 98 | + contents: write |
| 99 | + secrets: inherit |
| 100 | + with: |
| 101 | + source-branch: ${{ needs.get-version.outputs.branch }} |
| 102 | + version: ${{ needs.publish-release.outputs.version }} |
| 103 | + |
| 104 | + add-release-tag: |
| 105 | + needs: [publish-release, update-hugo-version, get-version] |
| 106 | + uses: ./.github/workflows/rw-git-create-tag.yml |
| 107 | + permissions: |
| 108 | + contents: write |
| 109 | + with: |
| 110 | + source-branch: ${{ needs.get-version.outputs.branch }} |
| 111 | + version: ${{ needs.publish-release.outputs.version }} |
| 112 | + is-latest: ${{ needs.publish-release.outputs.is-latest}} |
| 113 | + |
| 114 | + port-rel-branch-to-master: |
| 115 | + needs: [add-release-tag, update-hugo-version, get-version] |
| 116 | + uses: ./.github/workflows/rw-git-push.yml |
| 117 | + permissions: |
| 118 | + contents: write |
| 119 | + pull-requests: write |
| 120 | + secrets: inherit |
| 121 | + with: |
| 122 | + source-branch: ${{ needs.get-version.outputs.branch }} |
| 123 | + |
| 124 | + # DOCS |
| 125 | + |
| 126 | + update-apidocs-version: |
| 127 | + needs: [get-version, port-rel-branch-to-master, publish-release] |
| 128 | + uses: ./.github/workflows/rw-doc-release-apidocs.yml |
| 129 | + permissions: |
| 130 | + contents: write |
| 131 | + id-token: write |
| 132 | + secrets: inherit |
| 133 | + with: |
| 134 | + source-branch: ${{ needs.get-version.outputs.branch }} |
| 135 | + version: ${{ needs.publish-release.outputs.version }} |
| 136 | + is-new-latest: true |
| 137 | + |
| 138 | + publish-netlify: |
| 139 | + needs: port-rel-branch-to-master |
| 140 | + uses: ./.github/workflows/rw-doc-netlify-deploy.yml |
| 141 | + permissions: |
| 142 | + contents: write |
| 143 | + id-token: write |
| 144 | + secrets: inherit |
| 145 | + |
| 146 | + slack-notification: |
| 147 | + strategy: |
| 148 | + matrix: |
| 149 | + channels: ["#javascript-notifications", "#releases"] |
| 150 | + runs-on: [ubuntu-latest] |
| 151 | + needs: [publish-netlify, update-apidocs-version, publish-release] |
| 152 | + steps: |
| 153 | + - name: Notify to slack |
| 154 | + uses: slackapi/slack-github-action@v1.25.0 |
| 155 | + with: |
| 156 | + channel-id: ${{ matrix.channels }} |
| 157 | + slack-message: "The release of *gooddata-ui-sdk@${{ needs.publish-version.outputs.version }}*, has been successful. :tada:" |
| 158 | + env: |
| 159 | + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |
0 commit comments