diff --git a/.github/workflows/prepare_release.yml b/.github/workflows/prepare_release.yml index ceea63665fcb..7ba4a90a6f7a 100644 --- a/.github/workflows/prepare_release.yml +++ b/.github/workflows/prepare_release.yml @@ -7,8 +7,8 @@ env: on: workflow_dispatch: inputs: - tag: - description: New version tag + version: + description: New version number (e.g. '1.2.3' without the 'v' prefix) required: true jobs: @@ -37,19 +37,19 @@ jobs: with: ruby-version: 2.6 - - name: Bump Gem version + - name: Bump version run: | - git switch -c "release/${RELEASE_TAG}" + git switch -c "release/${RELEASE_VERSION}" bundle install - bundle exec gem bump -v "${RELEASE_TAG#v}" - git push -f --set-upstream origin "release/${RELEASE_TAG}" + bundle exec gem bump -v "${RELEASE_VERSION}" + git push -f --set-upstream origin "release/${RELEASE_VERSION}" env: - RELEASE_TAG: ${{ github.event.inputs.tag }} + RELEASE_VERSION: ${{ github.event.inputs.version }} - name: Create PR uses: actions/github-script@v5 env: - RELEASE_TAG: ${{ github.event.inputs.tag }} + RELEASE_VERSION: ${{ github.event.inputs.version }} BASE: ${{ github.event.ref }} with: github-token: ${{ steps.get_token.outputs.token }} @@ -57,10 +57,10 @@ jobs: const { data: notes } = await github.rest.repos.generateReleaseNotes({ owner: context.repo.owner, repo: context.repo.repo, - tag_name: process.env.RELEASE_TAG, + tag_name: `v${process.env.RELEASE_VERSION}`, }); const today = new Date().toJSON().slice(0, 10); - const header = [`# CHANGELOG\n\n## ${process.env.RELEASE_TAG} / ${today}\n`]; + const header = [`# CHANGELOG\n\n## ${process.env.RELEASE_VERSION} / ${today}\n`]; const changes = header.concat(notes.body.split("\n").slice(3)); const { data: content } = await github.rest.repos.getContent({ owner: context.repo.owner, @@ -74,7 +74,7 @@ jobs: const { data: head } = await github.rest.git.getRef({ owner: context.repo.owner, repo: context.repo.repo, - ref: `heads/release/${process.env.RELEASE_TAG}`, + ref: `heads/release/${process.env.RELEASE_VERSION}`, }); const { data: commit } = await github.rest.repos.createOrUpdateFileContents({ owner: context.repo.owner, @@ -82,15 +82,15 @@ jobs: message: "Update CHANGELOG", content: Buffer.from(newContent).toString("base64"), path: "CHANGELOG.md", - branch: `release/${process.env.RELEASE_TAG}`, + branch: `release/${process.env.RELEASE_VERSION}`, sha: content.sha, }); const { data: pr } = await github.rest.pulls.create({ owner: context.repo.owner, repo: context.repo.repo, - head: `release/${process.env.RELEASE_TAG}`, + head: `release/${process.env.RELEASE_VERSION}`, base: process.env.BASE, - title: `Release ${process.env.RELEASE_TAG}`, + title: `Release ${process.env.RELEASE_VERSION}`, body: "Update CHANGELOG", }); await github.rest.issues.addLabels({ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b0b95e5d95c4..78fccdf8db09 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,7 +30,7 @@ jobs: with: github-token: ${{ steps.get_token.outputs.token }} script: | - const tagName = process.env.RELEASE_BRANCH.split("/")[1]; + const tagName = `v${process.env.RELEASE_BRANCH.split("/")[1]}`; await github.rest.git.createRef({ owner: context.repo.owner, repo: context.repo.repo, diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f85d243cf9d..e3584d01e604 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # CHANGELOG -## v1.7.0 / 2022-02-18 +## 1.7.0 / 2022-02-18 ### Fixed * Add missing type to `CloudWorkloadSecurityAgentRuleAttributes` by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/743 diff --git a/RELEASING.md b/RELEASING.md index 70f1cf8ef3e2..cca1500472f5 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -28,12 +28,12 @@ The release process is controlled and run by GitHub Actions. ### Update Changelog 1. Open [prepare release](https://github.com/DataDog/datadog-api-client-ruby/actions/workflows/prepare_release.yml) and click on `Run workflow` dropdown. -1. Enter new version identifier in the `New version tag` input box (e.g. `v1.7.0`). +1. Enter new version identifier in the `New version number` input box (e.g. `1.8.0`). 1. Trigger the action by clicking on `Run workflow` button. ### Review -1. Review the generated pull-request for `release/` branch. +1. Review the generated pull-request for `release/` branch. 1. If everything is fine, merge the pull-request. 1. Check that the [release](https://github.com/DataDog/datadog-api-client-ruby/actions/workflows/release.yml) action created new release on GitHub.