-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (44 loc) · 1.69 KB
/
release_step1_create-release-pr.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
name: Release - Step 1 -> Create release PR
on:
workflow_dispatch:
inputs:
version:
description: 'Version number (semantic: major.minor.patch)'
required: true
changelogBase64:
description: 'Changelog (for last version only & base64 encoded)'
required: true
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0'
- name: Build .NET Release tool
run: dotnet build ./ReleaseTool/ReleaseTool.csproj
- name: Run .NET Release Tool
run: dotnet run --project ./ReleaseTool --version ${{ github.event.inputs.version }} --changelogBase64 "${{ github.event.inputs.changelogBase64 }}"
- name: Create Release Branch
run: |
git checkout -b release/${{ github.event.inputs.version }}
- name: Commit Changes
run: |
git config --global user.name 'Daniel Sierpiński'
git config --global user.email '[email protected]'
git add .
git commit -m "Release version ${{ github.event.inputs.version }}"
- name: Push Changes
run: |
git push origin release/${{ github.event.inputs.version }}
- name: Create Pull Request
uses: repo-sync/pull-request@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
pr_title: "Release version ${{ github.event.inputs.version }}"
pr_body: "${{ env.CHANGELOG }}"
destination_branch: "main"
source_branch: "release/${{ github.event.inputs.version }}"