Repository navigation
56 lines (49 loc) · 1.83 KB
/
Copy pathrelease.yaml
File metadata and controls
56 lines (49 loc) · 1.83 KB
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
name: Release
on:
workflow_dispatch:
jobs:
create-release-branch-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main
# Branch format: {YYYY.MM.DD}-{HH.MM}
- run: |
echo "RELEASE_DATE=$(date +'%Y.%m.%d-%H.%M')" >> $GITHUB_ENV
- name: Create a release branch
env:
RELEASE_DATE: ${{ env.RELEASE_DATE }}
shell: bash
run: |
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.PAT_FOR_VOICE_POST }}" \
-H "Content-Type: application/json" \
https://api.github.com/repos/${{ github.repository }}/git/refs \
-d "{\"ref\": \"refs/heads/release/${RELEASE_DATE}\",\"sha\":\"$(git rev-parse HEAD)\"}"
- name: Merge develop branch
env:
RELEASE_DATE: ${{ env.RELEASE_DATE }}
shell: bash
run: |
curl \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.PAT_FOR_VOICE_POST }}" \
https://api.github.com/repos/${{ github.repository }}/merges \
-d "{\"base\":\"release/${RELEASE_DATE}\",\"head\":\"develop\"}"
- name: Create a Release Pull Request
env:
RELEASE_DATE: ${{ env.RELEASE_DATE }}
shell: bash
run: |
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.PAT_FOR_VOICE_POST }}" \
-H "Content-Type: application/json" \
https://api.github.com/repos/${{ github.repository }}/pulls \
-d "{\"head\":\"release/${RELEASE_DATE}\",\"base\":\"main\",\"title\":\"Release ${RELEASE_DATE}\"}"