Skip to content

Commit 332491b

Browse files
authored
Update patch.yml
1 parent 609240c commit 332491b

File tree

1 file changed

+29
-32
lines changed

1 file changed

+29
-32
lines changed

.github/workflows/patch.yml

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: patch
22

33
on:
4-
workflow_dispatch
5-
#schedule:
6-
# - cron: "0 13 * * 1"
4+
schedule:
5+
- cron: "0 13 * * 1"
6+
workflow_dispatch:
77

88
jobs:
99
setup-outputs:
@@ -14,7 +14,7 @@ jobs:
1414
commitCount: ${{ steps.step2.outputs.commitCount }}
1515

1616
steps:
17-
- uses: actions/checkout@v5
17+
- uses: actions/checkout@v6
1818
with:
1919
fetch-depth: 0
2020
- id: step1
@@ -34,47 +34,44 @@ jobs:
3434

3535
runs-on: ubuntu-latest
3636

37-
#if: ${{needs.setup-outputs.outputs.commitCount >= 5}}
37+
if: ${{needs.setup-outputs.outputs.commitCount >= 5}}
3838
steps:
39-
- uses: actions/checkout@v5
39+
- uses: actions/checkout@v6
4040
with:
4141
fetch-depth: 0
4242
- id: step1
4343
run: echo "newTag=`echo $(echo ${{needs.setup-outputs.outputs.currentTag}} | awk 'BEGIN{FS=OFS="."} {$3+=1} 1')`" >> $GITHUB_ENV
44-
#- name: Edit csproj
45-
# run: sed -i 's+<VersionPrefix>${{needs.setup-outputs.outputs.currentTag}}</VersionPrefix>+<VersionPrefix>${{env.newTag}}</VersionPrefix>+g' ./CSharpToJavaScript.csproj
46-
#- uses: actions4git/setup-git@v1
47-
#- run: |
48-
# git commit -am "Nuget ${{env.newTag}}"
49-
# git push
44+
- name: Edit csproj
45+
run: sed -i 's+<VersionPrefix>${{needs.setup-outputs.outputs.currentTag}}</VersionPrefix>+<VersionPrefix>${{env.newTag}}</VersionPrefix>+g' ./CSharpToJavaScript.csproj
46+
- uses: actions4git/setup-git@v1
47+
- run: |
48+
git commit -am "Nuget ${{env.newTag}}"
49+
git push
5050
- run: git log ${{needs.setup-outputs.outputs.currentTag}}..master --format=format:'- [%s](https://github.com/TiLied/CSharpToJavaScript/commit/%H)%n' --output=./release.txt
51-
#- name: Create Release
52-
# id: create_release
53-
# uses: actions/create-release@v1
54-
# env:
55-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
56-
# with:
57-
# tag_name: ${{ env.newTag }}
58-
# release_name: ${{ env.newTag }}
59-
# body_path: ./release.txt
60-
# draft: false
61-
# prerelease: false
51+
- name: Create Release
52+
id: create_release
53+
uses: softprops/action-gh-release@v2
54+
with:
55+
tag_name: ${{ env.newTag }}
56+
body_path: ./release.txt
57+
draft: false
58+
prerelease: false
59+
generate_release_notes: true
6260
- name: Update .csproj
6361
#TODO? I don't know how to cat a file and paste...
6462
#- run: |
6563
# file=$(cat ./release.txt)
6664
# echo "releaseNotes=$file" >> $GITHUB_ENV
6765
run: sed -i 's+<PackageReleaseNotes></PackageReleaseNotes>+<PackageReleaseNotes>https://github.com/TiLied/CSharpToJavaScript/releases/tag/${{env.newTag}}</PackageReleaseNotes>+g' ./CSharpToJavaScript.csproj
68-
#- name: Setup .NET
69-
# uses: actions/setup-dotnet@v1
70-
# with:
71-
# dotnet-version: 10.0.x
72-
#- name: Generate NuGet package
73-
# run: dotnet pack --configuration Release --output packages
74-
#- name: Publish NuGet package
75-
# run: dotnet nuget push packages/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
66+
- name: Setup .NET
67+
uses: actions/setup-dotnet@v5
68+
with:
69+
dotnet-version: 10.0.x
70+
- name: Generate NuGet package
71+
run: dotnet pack --configuration Release --output ./packages
72+
- name: Publish NuGet package
73+
run: dotnet nuget push ./packages/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
7674
- run: cat ./CSharpToJavaScript.csproj
7775
- name: Environments
7876
run: |
7977
echo $newTag
80-
echo $releaseNotes

0 commit comments

Comments
 (0)