Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: 👷 Add GitHub Actions workflow for version release #11

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
@@ -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 "(?<=<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 }}"
git push
Loading