forked from longhorn/longhorn
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (61 loc) · 2.62 KB
/
create-release-task.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Create Release Tasks
on:
workflow_dispatch:
inputs:
release_version:
description: "Release Version, e.g. v1.8.1"
required: true
release_captain:
description: "GitHub Username of the Release Captain, formatted as @<github-username>"
required: true
qa_captain:
description: "GitHub Username of the QA Captain, formatted as @<github-username>"
required: true
jobs:
create-release-task:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Parse version information
id: parse_version
run: |
RELEASE_VERSION="${{ github.event.inputs.release_version }}"
MAJOR_MINOR_VERSION=$(echo "$RELEASE_VERSION" | sed -E 's/(v[0-9]+\.[0-9]+)\.[0-9]+/\1.0/')
BBRANCH_NAME=$(echo "$RELEASE_VERSION" | sed -E 's/(v[0-9]+\.[0-9]+)\.[0-9]+/\1.x/')
FEATURE_RELEASE="false"
if echo "$RELEASE_VERSION" | grep -Eq '^v[0-9]+\.[0-9]+\.0$'; then
FEATURE_RELEASE="true"
fi
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
echo "MAJOR_MINOR_VERSION=$MAJOR_MINOR_VERSION" >> $GITHUB_ENV
echo "BBRANCH_NAME=$BBRANCH_NAME" >> $GITHUB_ENV
- name: Create an issue - release task
uses: JasonEtco/create-an-issue@v2
with:
filename: .github/ISSUE_TEMPLATE/release.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_VERSION: ${{ github.event.inputs.release_version }}
MAJOR_MINOR_VERSION: ${{ env.MAJOR_MINOR_VERSION }}
BBRANCH_NAME: ${{ env.BBRANCH_NAME }}
FEATURE_RELEASE: ${{ env.FEATURE_RELEASE }}
RELEASE_CAPTAIN: ${{ github.event.inputs.release_captain }}
QA_CAPTAIN: ${{ github.event.inputs.qa_captain }}
- name: Create an issue - fix security issue for release
uses: JasonEtco/create-an-issue@v2
with:
filename: .github/ISSUE_TEMPLATE/fix-cve-issues-for-release.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_VERSION: ${{ github.event.inputs.release_version }}
- name: Create an issue - regular tasks for feature release
if: ${{ env.FEATURE_RELEASE == 'true' }}
uses: JasonEtco/create-an-issue@v2
with:
filename: .github/ISSUE_TEMPLATE/regular-tasks-for-feature-release.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_VERSION: ${{ github.event.inputs.release_version }}
FEATURE_RELEASE: ${{ env.FEATURE_RELEASE }}
BBRANCH_NAME: ${{ env.BBRANCH_NAME }}