Skip to content

Commit

Permalink
🚀 #103: Add github-actions script to create release automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharp0802 committed Sep 26, 2024
1 parent 7115e6c commit a65cec8
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
pull_request:
branches: [ "master" ]

permissions:
contents: write

jobs:
build:

Expand Down Expand Up @@ -33,4 +36,20 @@ jobs:
PROJECT_FILE_PATH: "src/sika/sika.csproj"
VERSION_REGEX: '<AssemblyVersion>(.*)<\/AssemblyVersion>'
NUGET_KEY: ${{secrets.NUGET_KEY}}
if: github.event_name != 'pull_request'
if: github.event_name != 'pull_request'

- name: Retrieve version
id: proj_version
uses: KageKirin/get-csproj-version@v0
with:
file: src/sika/sika.csproj
xpath: '//PropertyGroup/AssemblyVersion'

- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.proj_version.version }}
run: |
gh release create "v$VERSION" \
--repo="$GITHUB_REPOSITORY" \
--generate-notes

0 comments on commit a65cec8

Please sign in to comment.