-
-
Notifications
You must be signed in to change notification settings - Fork 3
75 lines (69 loc) · 1.98 KB
/
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
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
68
69
70
71
72
73
74
75
name: release
on:
pull_request:
branches:
- main
types: [closed]
jobs:
tag_and_release:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Calendar Version
id: calendar-version
uses: harm-matthias-harms/calendar-version@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: ncipollo/release-action@v1
with:
tag: ${{ steps.calendar-version.outputs.new-tag }}-alpha
skipIfReleaseExists: true
generateReleaseNotes: true
changelog:
needs: [tag_and_release]
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: orhun/git-cliff-action@v4
with:
config: cliff.toml
args: --verbose
env:
OUTPUT: CHANGELOG.adoc
GITHUB_REPO: ${{ github.repository }}
- run: |
git diff
git config --global user.email "[email protected]"
git config --global user.name "github-actions"
git add CHANGELOG.adoc
git commit -m "Update CHANGELOG" || exit 0
git push origin main
git fetch origin dev
git switch dev
git rebase main
git push origin dev
create_pull_request:
needs: [changelog]
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Create a pull request
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const headRef = '${{ steps.pull_request_head.outputs.ref }}'
const createParams = {
owner: context.repo.owner,
repo: context.repo.repo,
base: 'main',
head: 'dev',
title: 'Next release'
}
const { data } = await github.rest.pulls.create(createParams)
return data