Skip to content

ci: 👷 Fix version workflow #4

ci: 👷 Fix version workflow

ci: 👷 Fix version workflow #4

Workflow file for this run

name: Version
on:
workflow_dispatch:
inputs:
version:
description: 'Version to release "MAJOR.MINOR.PATCH.REVISION"'
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 "(?<=<Version>)[^<]+" $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 }}"
- name: Push changes
run: |
git push
- name: Build and Release
uses: esnya/ResoniteMetricsCounter/.github/workflows/dotnet-build.yml@master