|
1 | 1 | name: Release |
2 | 2 |
|
| 3 | +env: |
| 4 | + GIT_AUTHOR_EMAIL: "packages@datadoghq.com" |
| 5 | + GIT_AUTHOR_NAME: "ci.datadog-api-spec" |
| 6 | + |
3 | 7 | on: |
4 | 8 | pull_request: |
5 | 9 | types: [closed] |
|
18 | 22 | with: |
19 | 23 | app_id: ${{ secrets.PIPELINE_GITHUB_APP_ID }} |
20 | 24 | private_key: ${{ secrets.PIPELINE_GITHUB_APP_PRIVATE_KEY }} |
| 25 | + |
21 | 26 | - name: Create release |
22 | 27 | uses: actions/github-script@v5 |
23 | 28 | env: |
|
38 | 43 | generate_release_notes: true, |
39 | 44 | tag_name: tagName, |
40 | 45 | }); |
| 46 | +
|
| 47 | + - uses: actions/checkout@v2 |
| 48 | + with: |
| 49 | + fetch-depth: 0 |
| 50 | + token: ${{ steps.get_token.outputs.token }} |
| 51 | + |
| 52 | + - name: Setup Git |
| 53 | + run: | |
| 54 | + git config user.name "${GIT_AUTHOR_NAME}" |
| 55 | + git config user.email "${GIT_AUTHOR_EMAIL}" |
| 56 | +
|
| 57 | + - name: Set up Ruby 2.6 |
| 58 | + uses: ruby/setup-ruby@v1 |
| 59 | + with: |
| 60 | + ruby-version: 2.6 |
| 61 | + |
| 62 | + - name: Bump Gem version |
| 63 | + run: | |
| 64 | + git switch -c "${POST_RELEASE_BRANCH}" |
| 65 | + bundle install |
| 66 | + bundle exec gem bump -v dev |
| 67 | + git push -f --set-upstream origin "${POST_RELEASE_BRANCH}" |
| 68 | + env: |
| 69 | + POST_RELEASE_BRANCH: post-${{ github.head_ref }} |
| 70 | + |
| 71 | + - name: Create PR |
| 72 | + uses: actions/github-script@v5 |
| 73 | + env: |
| 74 | + POST_RELEASE_BRANCH: post-${{ github.head_ref }} |
| 75 | + BASE: master |
| 76 | + with: |
| 77 | + github-token: ${{ steps.get_token.outputs.token }} |
| 78 | + script: | |
| 79 | + const { data: pr } = await github.rest.pulls.create({ |
| 80 | + owner: context.repo.owner, |
| 81 | + repo: context.repo.repo, |
| 82 | + head: process.env.POST_RELEASE_BRANCH, |
| 83 | + base: process.env.BASE, |
| 84 | + title: "Post release", |
| 85 | + body: "Bump to dev version", |
| 86 | + }); |
| 87 | + await github.rest.issues.addLabels({ |
| 88 | + issue_number: pr.number, |
| 89 | + owner: context.repo.owner, |
| 90 | + repo: context.repo.repo, |
| 91 | + labels: ["changelog/no-changelog"], |
| 92 | + }); |
0 commit comments