Skip to content

Commit 0d669ec

Browse files
authored
Merge pull request #12 from NiharR27/develop
Merge develop into master for release 2.0.0
2 parents 497fc79 + 6cba484 commit 0d669ec

8 files changed

+89
-338
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,58 @@
1-
name: "Draft new release"
1+
name: "Release 1 - Initial New Release"
22

33
on:
44
workflow_dispatch:
55
inputs:
66
version:
77
description: "The version you want to release."
88
required: true
9+
default: "1.0.0"
910

1011
jobs:
1112
draft-new-release:
1213
name: "Draft a new release"
1314
runs-on: ubuntu-latest
1415
steps:
15-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v4
1617

1718
- name: Create release branch
1819
run: git checkout -b release/${{ github.event.inputs.version }}
1920

20-
# In order to make a commit, we need to initialize a user.
21-
# You may choose to write something less generic here if you want, it doesn't matter functionality wise.
2221
- name: Initialize mandatory git config
2322
run: |
2423
git config user.name "GitHub actions"
2524
git config user.email noreply@github.com
2625
27-
# This step will differ depending on your project setup
28-
# Fortunately, yarn has a built-in command for doing this!
2926
- name: Bump version in package.json
3027
run: yarn version --new-version ${{ github.event.inputs.version }} --no-git-tag-version
3128

3229
- name: Commit manifest files
3330
id: make-commit
3431
run: |
3532
git add .
36-
git commit --message "Prepare release ${{ github.event.inputs.version }}"
37-
38-
echo "::set-output name=commit::$(git rev-parse HEAD)"
33+
git commit --message "Bump version to ${{ github.event.inputs.version }}"
3934
4035
- name: Push new branch
4136
run: git push origin release/${{ github.event.inputs.version }}
4237

4338
- name: Create pull request
44-
uses: thomaseizinger/create-pull-request@1.0.0
39+
uses: thomaseizinger/create-pull-request@1.4.0
4540
env:
4641
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4742
with:
4843
head: release/${{ github.event.inputs.version }}
49-
base: master
44+
base: develop
5045
title: Release version ${{ github.event.inputs.version }}
51-
reviewers: ${{ github.actor }} # By default, we request a review from the person who triggered the workflow.
52-
# Write a nice message to the user.
53-
# We are claiming things here based on the `publish-new-release.yml` workflow.
54-
# You should obviously adopt it to say the truth depending on your release workflow :)
46+
reviewers: ${{ github.actor }} #Assign the PR to the user who triggered the release
47+
# team-reviewers: |
48+
# developers
49+
# qa-team
5550
body: |
5651
Hi @${{ github.actor }}!
5752
5853
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 }}.
59-
I've updated the changelog and bumped the versions in the manifest files in this commit: ${{ steps.make-commit.outputs.commit }}.
54+
I've bumped the versions in the manifest files in this commit: ${{ steps.make-commit.outputs.commit }}.
6055
6156
Merging this PR will create a GitHub release and upload any assets that are created as part of the release build.
57+
58+
Happy merging!
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "Release 2 - Create PR to merge develop into master"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
types:
8+
- closed
9+
10+
jobs:
11+
create-develop-to-master-pr:
12+
name: "Create PR to merge develop into master"
13+
runs-on: ubuntu-latest
14+
if: github.event.pull_request.merged == true &&
15+
startsWith(github.event.pull_request.head.ref, 'release/')
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Extract version from merged PR
21+
run: |
22+
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
23+
VERSION=${BRANCH_NAME#release/}
24+
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
25+
26+
- name: Create PR
27+
uses: thomaseizinger/create-pull-request@1.4.0
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
with:
31+
head: develop
32+
base: master
33+
title: Merge develop into master for release ${{ env.RELEASE_VERSION }}
34+
reviewers: ${{ github.actor }} #Assign the PR to the user who merged the release branch
35+
body: |
36+
Hi @${{ github.actor }}!
37+
38+
This PR merges the develop branch into master for the release ${{ env.RELEASE_VERSION }}.
39+
Once this PR is merged, the release will be published.
40+
41+
Happy merging!
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "Release 3 - 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+
if: github.event.pull_request.merged == true
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Get version from package.json
20+
run: |
21+
VERSION=$(node -e "console.log(require('./package.json').version)")
22+
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
23+
24+
- name: Create Release
25+
uses: thomaseizinger/create-release@1.0.0
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
with:
29+
target_commitish: ${{ github.event.pull_request.merge_commit_sha }}
30+
tag_name: ${{ env.RELEASE_VERSION }}
31+
name: ${{ env.RELEASE_VERSION }}
32+
draft: false
33+
prerelease: false

.github/workflows/build.yml

-7
This file was deleted.

.github/workflows/publish_new_release.yml

-59
This file was deleted.

.github/workflows/release.yml

-147
This file was deleted.

0 commit comments

Comments
 (0)