Bump the all group with 2 updates (#30) #21
Workflow file for this run
This file contains 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: 📦 Nuget Release | |
on: | |
push: | |
tags: | |
- '*' | |
concurrency: | |
group: publish-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
jobs: | |
update-version: | |
name: 📝 Update version | |
runs-on: ubuntu-latest | |
outputs: | |
tag_name: ${{ steps.tag.outputs.tag_name }} | |
steps: | |
- name: 📦 Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: main | |
- name: 🔍 Get Tag | |
id: tag | |
run: echo "tag_name=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT" | |
- name: 🖊️ Update version in .csproj files | |
run: | | |
TAG=${{ steps.tag.outputs.tag_name }} | |
find . -name '*.csproj' -type f -exec sed -i "s/<Version>.*<\/Version>/<Version>${TAG//v}<\/Version>/g" {} \; | |
- name: 📋 Commit changes | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add . | |
git commit -m "auto: Update version to ${{ steps.tag.outputs.tag_name }}" || echo "No changes to commit" | |
- name: 🚚 Push changes | |
continue-on-error: true | |
run: git push | |
- name: 🖊️ Job summary | |
run: | | |
echo "Tag name: ${{ steps.tag.outputs.tag_name }}" >> $GITHUB_STEP_SUMMARY | |
build: | |
name: 🛠️ Build | |
runs-on: windows-latest | |
needs: update-version | |
permissions: | |
packages: write | |
contents: read | |
environment: | |
name: Nuget Release | |
url: https://www.nuget.org/packages/DaanV2.UUID.Net/ | |
steps: | |
- name: 📦 Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: main | |
- name: 🛠️ Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
7.0.x | |
8.0.x | |
- name: 📥 Restore dependencies | |
run: dotnet restore --verbosity normal | |
- name: 🔨 Build | |
run: dotnet build --no-restore --verbosity normal | |
- name: 📋 Test | |
run: dotnet test --no-restore --verbosity normal | |
- name: 📦 Create the package | |
run: dotnet pack --configuration Release Library | |
- name: 🚚 Publish the package to Nuget | |
run: | | |
cd ${{ github.workspace }}/Library/bin/Release/ | |
dotnet nuget push *.nupkg --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json |