From 2e0a53cfb0d13605012d935ba38ad5d7c8de2eab Mon Sep 17 00:00:00 2001 From: esnya <2088693+esnya@users.noreply.github.com> Date: Mon, 23 Dec 2024 15:28:33 +0900 Subject: [PATCH] =?UTF-8?q?ci:=20=F0=9F=91=B7=20Add=20GitHub=20Actions=20w?= =?UTF-8?q?orkflow=20for=20version=20release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/version.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/version.yml diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml new file mode 100644 index 0000000..56c9f53 --- /dev/null +++ b/.github/workflows/version.yml @@ -0,0 +1,35 @@ +on: + workflow_dispatch: + inputs: + version: + description: 'Version to release' + required: true + +jobs: + version: + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Retrieve previous version from csproj + id: get_version + run: | + FILE=$(find . -name "*.csproj" | head -n 1) + VERSION=$(grep -oPm1 "(?<=)[^<]+" $FILE) + echo "previousVersion=$VERSION" >> $GITHUB_OUTPUT + + - name: Set version in csproj + run: | + FILE=$(find . -name "*.csproj" | head -n 1) + sed -i "s/>${{ steps.get_version.outputs.previousVersion }}/>${{ github.event.inputs.version }}/" $FILE + + - name: Commit changes + run: | + git config --local user.name "github-actions[bot]" + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add . + git commit -m "chore: 📦️ v${{ github.event.inputs.version }}" + git push