Skip to content
This repository was archived by the owner on Mar 2, 2026. It is now read-only.

v0.0.3

v0.0.3 #2

Workflow file for this run

name: publish
on:
workflow_dispatch:
push:
tags:
- '*'
jobs:
build:
permissions:
contents: write
runs-on: windows-latest
env:
Solution_Path: AnyBar.Localization.slnx
Project_Path: AnyBar.Localization\AnyBar.Localization.csproj
steps:
# Checkout codes
- name: Checkout
uses: actions/checkout@v6
# Install the .NET Core workload
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
9.0.x
# Restore dependencies
- name: Restore dependencies
run: dotnet restore ${{ env.Solution_Path }}
# Build the project
- name: Build
run: dotnet build ${{ env.Solution_Path }} --configuration Release --no-restore
# Execute all unit tests in the solution
- name: Execute unit tests
run: dotnet test ${{ env.Solution_Path }} --configuration Release --no-build
# Pack the NuGet package
- name: Create NuGet package
run: dotnet pack ${{ env.Project_Path }} --configuration Release --no-build --output nupkgs
# Publish to NuGet.org
- name: Push to NuGet
run: nuget push nupkgs\*.nupkg -source 'https://api.nuget.org/v3/index.json' -apikey ${{ secrets.NUGET_API_KEY }}
# Get package version
- name: Get Package Version
run: |
$version = [system.diagnostics.fileversioninfo]::getversioninfo("AnyBar.Localization\bin\Release\AnyBar.Localization.dll").fileversion
echo "release_version=$version" | out-file -filepath $env:github_env -encoding utf-8 -append
# Publish to GitHub releases
- name: Publish
uses: softprops/action-gh-release@v2
with:
files: nupkgs/*.nupkg
tag_name: "v${{ env.release_version }}"