patch #72
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: patch | |
| on: | |
| workflow_dispatch | |
| #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: | |
| permissions: | |
| contents: write | |
| 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>${{env.newTag}}</VersionPrefix>+g' ./CSharpToJavaScript.csproj | |
| #- uses: actions4git/setup-git@v1 | |
| #- run: | | |
| # git commit -am "Nuget ${{env.newTag}}" | |
| # git push | |
| - run: git log ${{needs.setup-outputs.outputs.currentTag}}..master --format=format:'- [%s](https://github.com/TiLied/CSharpToJavaScript/commit/%H)%n' --output=./release.txt | |
| #- name: Create Release | |
| # id: create_release | |
| # uses: actions/create-release@v1 | |
| # env: | |
| # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
| # with: | |
| # tag_name: ${{ env.newTag }} | |
| # release_name: ${{ env.newTag }} | |
| # body_path: ./release.txt | |
| # draft: false | |
| # prerelease: false | |
| - name: Update .csproj | |
| run: | | |
| file=$(cat ./relese.txt) | |
| echo "releaseNotes=$file" >> $GITHUB_ENV | |
| - run: sed -i 's+<PackageReleaseNotes></PackageReleaseNotes>+<PackageReleaseNotes>${{env.releaseNotes}}</PackageReleaseNotes>+g' ./CSharpToJavaScript.csproj | |
| #- name: Setup .NET | |
| # uses: actions/setup-dotnet@v1 | |
| # with: | |
| # dotnet-version: 10.0.x | |
| #- name: Generate NuGet package | |
| # run: dotnet pack --configuration Release --output packages | |
| #- name: Publish NuGet package | |
| # run: dotnet nuget push packages/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json | |
| - run: cat ./CSharpToJavaScript.csproj | |
| - name: Environments | |
| run: | | |
| echo $newTag | |
| echo $releaseNotes |