-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (42 loc) · 1.6 KB
/
patch.yml
File metadata and controls
51 lines (42 loc) · 1.6 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
name: patch
on: workflow_dispatch
#on:
#schedule:
# - cron: "0 13 * * 1"
jobs:
setup-outputs:
runs-on: ubuntu-latest
outputs:
currentTag: ${{ steps.step1.outputs.currentTag }}
commitCount: ${{ steps.step2.outputs.commitCount }}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- id: step1
run: echo "currentTag=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_OUTPUT
- id: step2
run: echo "commitCount=`echo $(git rev-list --count ${{steps.step1.outputs.currentTag}}..master)`" >> $GITHUB_OUTPUT
- name: Outputs
run: |
echo "currentTag: ${{steps.step1.outputs.currentTag}}"
echo "commitCount: ${{steps.step2.outputs.commitCount}}"
make-patch:
needs: setup-outputs
runs-on: ubuntu-latest
if: ${{needs.setup-outputs.outputs.commitCount >= 5}}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- id: step1
run: echo "newTag=`echo $(echo ${{needs.setup-outputs.outputs.currentTag}} | awk 'BEGIN{FS=OFS="."} {$3+=1} 1')`" >> $GITHUB_ENV
- name: Edit csproj
run: sed -i 's+<VersionPrefix>${{needs.setup-outputs.outputs.currentTag}}</VersionPrefix>+<VersionPrefix>$newTag</VersionPrefix>+g' ./README.md
- run: cat ./README.md
- id: step2
run: echo "realeseNote=`echo $(git log 0.0.09..master --format=format:'- [%s](https://github.com/TiLied/CSharpToJavaScript/commit/%H)')`" >> $GITHUB_ENV
- name: Environments
run: |
echo $newTag
echo $realeseNote