patch #44
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 | |
#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>${{env.newTag}}</VersionPrefix>+g' ./README.md | |
- run: | | |
git config --global user.name 'TiLied' | |
git config --global user.email 'TiLied@users.noreply.github.com' | |
git commit -am "Nuget ${{env.newTag}}" | |
git push | |
- 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: 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: Release ${{ env.newTag }} | |
body: ${{ env.realeseNote }} | |
draft: true | |
prerelease: true | |
#update release notes in csproj | |
#build nuget package | |
#upload | |
- name: Environments | |
run: | | |
echo $newTag | |
echo $realeseNote |