Skip to content

Commit 1732782

Browse files
authored
Merge branch 'release/1.0.0-rc.1'
Release v1.0.0 rc.1
2 parents caf1db7 + bed1cf1 commit 1732782

File tree

4 files changed

+89
-0
lines changed

4 files changed

+89
-0
lines changed

.github/workflows/release.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: release
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
types:
8+
- closed
9+
10+
env:
11+
BRANCH_MAIN: main
12+
BRANCH_DEVELOP: develop
13+
14+
jobs:
15+
release:
16+
name: Publish new release
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: write
20+
# only merge pull requests that begin with 'release/' or 'hotfix/'
21+
if: github.event.pull_request.merged == true &&
22+
(startsWith(github.event.pull_request.head.ref, 'release/') || startsWith(github.event.pull_request.head.ref, 'hotfix/'))
23+
24+
steps:
25+
- name: Extract version from release branch
26+
if: startsWith(github.event.pull_request.head.ref, 'release/')
27+
run: |
28+
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
29+
VERSION=${BRANCH_NAME#release/}
30+
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
31+
32+
- name: Extract version from hotfix branch
33+
if: startsWith(github.event.pull_request.head.ref, 'hotfix/')
34+
run: |
35+
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
36+
VERSION=${BRANCH_NAME#hotfix/}
37+
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
38+
39+
- name: Create release
40+
uses: ncipollo/release-action@v1
41+
with:
42+
token: ${{ secrets.GH_TOKEN }}
43+
commit: ${{ github.event.pull_request.merge_commit_sha }}
44+
tag: ${{ env.RELEASE_VERSION }}
45+
name: ${{ env.RELEASE_VERSION }}
46+
draft: false
47+
prerelease: false
48+
generateReleaseNotes: true
49+
50+
- name: Create merge PR ${{ github.event.pull_request.head.ref }} -> ${{ env.BRANCH_DEVELOP }}
51+
uses: peter-evans/create-pull-request@v4
52+
with:
53+
token: ${{ secrets.GH_TOKEN }}
54+
base: ${{ env.BRANCH_DEVELOP }}
55+
branch: ${{ github.event.pull_request.head.ref }}
56+
delete-branch: false
57+
commit-message: Merge branch '${{ github.event.pull_request.head.ref }}' into ${{ env.BRANCH_DEVELOP }}
58+
title: Merge branch '${{ github.event.pull_request.head.ref }}' into ${{ env.BRANCH_DEVELOP }}
59+
body: |
60+
This PR merges the ${{ github.event.pull_request.head.ref }} branch back into ${{ env.BRANCH_DEVELOP }} branch.
61+
This happens to ensure that the updates that happened on the ${{ github.event.pull_request.head.ref }} branch, i.e. CHANGELOG and manifest updates are also present on the ${{ env.BRANCH_DEVELOP }} branch.
62+
63+
Auto-generated by [create-pull-request][1]
64+
65+
[1]: https://github.com/peter-evans/create-pull-request
66+
labels: |
67+
automated-pr

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4+
5+
### 1.0.1-rc.0 (2023-02-12)
6+
7+
### Features
8+
9+
* **ci:** add workflow release ([b6d71ae](https://github.com/ansidev/sample-gitflow-release-workflows/commit/b6d71aeb3e913af7261e62c9091802078f6cb6b5))

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# sample-gitflow-release-workflows
2+
3+
Sample Gitflow release workflow using GitHub Actions.
4+
5+
## Manual
6+
7+
- Workflow definitions: [release.yaml](./.github/workflows/release.yaml)
8+
- You have to update two env variables: `BRANCH_MAIN`, `BRANCH_DEVELOP` if necessary.
9+
10+
## License
11+
12+
This source code is available under the [MIT License](/LICENSE).

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.0.0-rc.1

0 commit comments

Comments
 (0)