Skip to content

Commit 4071a46

Browse files
authored
Strip v from version (#754)
1 parent 6c0dcf4 commit 4071a46

3 files changed

Lines changed: 54 additions & 2 deletions

File tree

.github/workflows/prepare_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
run: |
4242
git switch -c "release/${RELEASE_TAG}"
4343
bundle install
44-
bundle exec gem bump -v "${RELEASE_TAG}"
44+
bundle exec gem bump -v "${RELEASE_TAG#v}"
4545
git push -f --set-upstream origin "release/${RELEASE_TAG}"
4646
env:
4747
RELEASE_TAG: ${{ github.event.inputs.tag }}

.github/workflows/release.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Release
22

3+
env:
4+
GIT_AUTHOR_EMAIL: "packages@datadoghq.com"
5+
GIT_AUTHOR_NAME: "ci.datadog-api-spec"
6+
37
on:
48
pull_request:
59
types: [closed]
@@ -18,6 +22,7 @@ jobs:
1822
with:
1923
app_id: ${{ secrets.PIPELINE_GITHUB_APP_ID }}
2024
private_key: ${{ secrets.PIPELINE_GITHUB_APP_PRIVATE_KEY }}
25+
2126
- name: Create release
2227
uses: actions/github-script@v5
2328
env:
@@ -38,3 +43,50 @@ jobs:
3843
generate_release_notes: true,
3944
tag_name: tagName,
4045
});
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+
});

RELEASING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ The release process is controlled and run by GitHub Actions.
3939
### Publish
4040

4141
1. A github action will kick off that builds and publishes this tag to Ruby Gem. Check that the [Ruby Gem is published](https://rubygems.org/gems/datadog_api_client).
42-
1. Bump the version to a dev version (e.g. `gem bump -v 1.7.1.dev`), open a PR and merge it to master.
42+
1. Review and merge generated `Post release` pull-request with `dev` version bump.

0 commit comments

Comments
 (0)