Skip to content

Commit 2d3d0bf

Browse files
authored
Merge pull request #715 from postmanlabs/release/v4.12.0
Release version v4.12.0
2 parents 0540979 + c0ea8b0 commit 2d3d0bf

21 files changed

+6284
-3049
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Draft new release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: The version you want to release. Must be a valid semver version.
8+
required: true
9+
type: string
10+
11+
jobs:
12+
draft-new-release:
13+
if: startsWith(github.event.inputs.version, 'v')
14+
name: Draft a new release
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
pull-requests: write
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v3
23+
24+
- name: Create release branch
25+
run: git checkout -b release/${{ github.event.inputs.version }}
26+
27+
- name: Update changelog
28+
uses: thomaseizinger/keep-a-changelog-new-release@1.1.0
29+
with:
30+
version: ${{ github.event.inputs.version }}
31+
32+
- name: Initialize mandatory git config
33+
run: |
34+
git config user.name "GitHub Actions"
35+
git config user.email noreply@github.com
36+
37+
- name: Bump version
38+
run: npm version ${{ github.event.inputs.version }} --git-tag-version false
39+
40+
- name: Commit changelog and manifest files
41+
id: make-commit
42+
run: |
43+
git add CHANGELOG.md package.json package-lock.json
44+
git commit --message "Prepare release ${{ github.event.inputs.version }}"
45+
echo "::set-output name=commit::$(git rev-parse HEAD)"
46+
47+
- name: Push new branch
48+
run: git push origin release/${{ github.event.inputs.version }}
49+
50+
- name: Create pull request for master
51+
uses: thomaseizinger/create-pull-request@1.0.0
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
with:
55+
head: release/${{ github.event.inputs.version }}
56+
base: master
57+
title: "Release version ${{ github.event.inputs.version }}"
58+
reviewers: ${{ github.actor }}
59+
body: |
60+
Hi @${{ github.actor }}!
61+
62+
This PR was created in response to a manual trigger of the release workflow here: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}.
63+
I've updated the changelog and bumped the versions in the manifest files in this commit: ${{ steps.make-commit.outputs.commit }}.
64+
65+
- name: Create pull request for develop
66+
uses: thomaseizinger/create-pull-request@1.0.0
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
with:
70+
head: release/${{ github.event.inputs.version }}
71+
base: develop
72+
title: "Release version ${{ github.event.inputs.version }}"
73+
reviewers: ${{ github.actor }}
74+
body: |
75+
Hi @${{ github.actor }}!
76+
77+
This PR was created in response to a manual trigger of the release workflow here: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}.
78+
I've updated the changelog and bumped the versions in the manifest files in this commit: ${{ steps.make-commit.outputs.commit }}.

.github/workflows/integration.yml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,38 @@
11
name: Test
22

33
on:
4-
[pull_request]
4+
push:
5+
branches: [develop, master]
6+
pull_request:
57

68
jobs:
79
Unit-Tests:
810
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
node-version: [14.x, 16.x, 18.x]
914
steps:
10-
- uses: actions/checkout@v2
11-
- uses: actions/setup-node@v1
15+
- uses: actions/checkout@v3
16+
- name: Use Node.js ${{ matrix.node-version }}
17+
uses: actions/setup-node@v3
1218
with:
13-
node-version: '14.x'
14-
- run: npm install
19+
node-version: ${{ matrix.node-version }}
20+
- run: npm ci
1521
- run: npm run test-lint
1622
- run: npm run test-system
1723
- run: npm run test-unit
1824

1925
Regression:
2026
needs: Unit-Tests
2127
runs-on: ubuntu-latest
28+
strategy:
29+
matrix:
30+
node-version: [14.x, 16.x, 18.x]
2231
steps:
23-
- uses: actions/checkout@v2
24-
- uses: actions/setup-node@v1
32+
- uses: actions/checkout@v3
33+
- name: Use Node.js ${{ matrix.node-version }}
34+
uses: actions/setup-node@v3
2535
with:
26-
node-version: '14.x'
27-
- run: npm install
36+
node-version: ${{ matrix.node-version }}
37+
- run: npm ci
2838
- run: npm run test-regression
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: "Publish new release"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
types:
8+
- closed
9+
10+
jobs:
11+
release:
12+
name: Publish new release
13+
runs-on: ubuntu-latest
14+
# only merged pull requests that begin with 'release/' or 'hotfix/' must trigger this job
15+
if: github.event.pull_request.merged == true &&
16+
(contains(github.event.pull_request.head.ref, 'release/') || contains(github.event.pull_request.head.ref, 'hotfix/'))
17+
permissions:
18+
contents: write
19+
20+
steps:
21+
- name: Extract version from branch name (for release branches)
22+
if: contains(github.event.pull_request.head.ref, 'release/')
23+
run: |
24+
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
25+
VERSION=${BRANCH_NAME#release/}
26+
27+
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
28+
29+
- name: Extract version from branch name (for hotfix branches)
30+
if: contains(github.event.pull_request.head.ref, 'hotfix/')
31+
run: |
32+
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
33+
VERSION=${BRANCH_NAME#hotfix/}
34+
35+
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
36+
37+
- name: Create Release
38+
uses: thomaseizinger/create-release@1.0.0
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
with:
42+
target_commitish: ${{ github.event.pull_request.merge_commit_sha }}
43+
tag_name: ${{ env.RELEASE_VERSION }}
44+
name: ${{ env.RELEASE_VERSION }}
45+
draft: false
46+
prerelease: false

0 commit comments

Comments
 (0)