diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9a4ea5e..721ac6e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,6 +37,23 @@ jobs: with: dotnet-version: '8.0.x' + + - name: Update Directory.Build.props version from tag + working-directory: Rewrite + run: | + sed -i -E "s/.*<\/VersionPrefix>/${GITHUB_REF#refs/tags/}<\/VersionPrefix>/g" Directory.Build.props + + - name: Commit version updates + working-directory: Rewrite + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git add Directory.Build.props + git commit -m "bump version ${GITHUB_REF#refs/tags/}" + git push https://${GH_TOKEN}@github.com/openrewrite/rewrite-csharp.git HEAD:main + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: build run: | (cd Rewrite && dotnet publish Rewrite.sln)