-
Notifications
You must be signed in to change notification settings - Fork 10
40 lines (38 loc) · 1.63 KB
/
publish-new-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: publish-new-release-on-main
on:
pull_request:
branches:
- main
types:
- closed
jobs:
release:
name: Publish new release for merged PR's
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true # only merged pull requests must trigger this job
steps:
- name: Extract version from branch name (for release branches)
if: startsWith(github.event.pull_request.head.ref, 'release/')
run: |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
VERSION=${BRANCH_NAME#release/}
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
- name: Extract version from branch name (for hotfix branches)
if: startsWith(github.event.pull_request.head.ref, 'hotfix/')
run: |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
VERSION=${BRANCH_NAME#hotfix/}
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
- name: Merge main into develop branch
uses: thomaseizinger/create-pull-request@1.0.0
env:
GITHUB_TOKEN: ${{ secrets.MERGE_PAT_TOKEN }}
with:
head: main
base: develop
title: Merge main into develop branch
body: |
This PR merges the main branch back into develop.
This happens to ensure that the updates that happend on the release branch, i.e. CHANGELOG and manifest updates are also present on the dev branch.
# if needed, you can checkout the latest main here, build artifacts and publish / deploy them somewhere
# the create-release action has an output `upload_url` output that you can use to upload assets