Enables package generation on build #3
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Create Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: 9.0.x | |
| - name: Extract version from tag | |
| id: get_version | |
| run: | | |
| VERSION=${GITHUB_REF#refs/tags/v} | |
| echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Extracted version: $VERSION from ${GITHUB_REF}" | |
| - name: Build | |
| run: dotnet build --configuration Release /p:Version=${{ steps.get_version.outputs.VERSION }} | |
| - name: Generate changelog | |
| id: changelog | |
| uses: metcalfc/changelog-generator@v4.0.1 | |
| with: | |
| myToken: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref }} | |
| release_name: Release ${{ steps.get_version.outputs.VERSION }} | |
| body: | | |
| # VConSharp ${{ steps.get_version.outputs.VERSION }} | |
| ## Changes | |
| ${{ steps.changelog.outputs.changelog }} | |
| ## Installation | |
| ``` | |
| dotnet add package VConSharp --version ${{ steps.get_version.outputs.VERSION }} | |
| ``` | |
| draft: false | |
| prerelease: false |