From 2f2ce07bb41ac84718d86501975939c63ef1cbc5 Mon Sep 17 00:00:00 2001 From: Snoozeds <88577069+Snoozeds@users.noreply.github.com> Date: Sun, 5 Jan 2025 22:06:27 +0000 Subject: [PATCH] Attempt fix root version.txt not updating --- .github/workflows/dotnet.yml | 38 ++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 92a5798..e99c073 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -3,12 +3,29 @@ on: release: types: - published - permissions: contents: write - jobs: + update-version: + name: Update Version File + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Update version.txt + run: | + echo "${{ github.event.release.tag_name }}" > version.txt + git config user.name "GitHub Actions" + git config user.email "actions@github.com" + git add version.txt + git commit -m "Update version.txt for release ${{ github.event.release.tag_name }}" + git push origin HEAD:main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + build: + needs: update-version name: Build and Attach Release Assets runs-on: ${{ matrix.os }} strategy: @@ -41,23 +58,10 @@ jobs: - name: Build run: dotnet publish src/UnrealLocresEditor.Desktop --runtime ${{ matrix.runtime }} -c Release --self-contained true -p:PublishSingleFile=true --p:PublishTrimmed=true --output ./output/${{ matrix.runtime }} - - name: Create version.txt + - name: Create version.txt for artifacts shell: bash - run: | - echo "${{ github.event.release.tag_name }}" > ./output/${{ matrix.runtime }}/version.txt - echo "${{ github.event.release.tag_name }}" > ./version.txt + run: echo "${{ github.event.release.tag_name }}" > ./output/${{ matrix.runtime }}/version.txt - - name: Commit and push version.txt to repo - run: | - git config user.name "GitHub Actions" - git config user.email "actions@github.com" - git add ./output/${{ matrix.runtime }}/version.txt - git commit -m "Update version.txt for release ${{ github.event.release.tag_name }}" - git push --force origin HEAD:${{ github.event.release.tag_name }} - git push --force origin HEAD:main - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Create artifacts directory run: mkdir -p artifacts