2024-10-01 23:18:55 -04:00
|
|
|
name: build-packages
|
2025-02-24 09:14:30 +00:00
|
|
|
|
2024-10-01 23:18:55 -04:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2024-10-01 23:19:36 -04:00
|
|
|
- 'master'
|
2025-02-24 09:14:30 +00:00
|
|
|
|
2024-10-01 23:18:55 -04:00
|
|
|
jobs:
|
2025-03-01 14:42:26 -05:00
|
|
|
nuget-package:
|
2024-10-01 23:18:55 -04:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
DOTNET_INSTALL_DIR: "/home/runner"
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
packages: write
|
2025-02-24 09:14:30 +00:00
|
|
|
|
2024-10-01 23:18:55 -04:00
|
|
|
steps:
|
2025-02-24 09:14:30 +00:00
|
|
|
- name: Cleanup build folder
|
2024-10-01 23:18:55 -04:00
|
|
|
run: |
|
2025-02-24 09:14:30 +00:00
|
|
|
rm -rf ./* ./.??* || true
|
|
|
|
|
|
|
|
- name: Set up .NET
|
|
|
|
uses: actions/setup-dotnet@v3
|
2025-02-24 07:55:38 +00:00
|
|
|
with:
|
|
|
|
dotnet-version: 8.0.x
|
|
|
|
|
2025-02-24 09:14:30 +00:00
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v3
|
2024-10-01 23:18:55 -04:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2025-02-24 09:14:30 +00:00
|
|
|
- name: Install GitVersion
|
|
|
|
uses: gittools/actions/gitversion/setup@v1.1.1
|
2024-10-01 23:18:55 -04:00
|
|
|
with:
|
|
|
|
versionSpec: '5.x'
|
2025-02-24 09:14:30 +00:00
|
|
|
|
|
|
|
- name: Determine version with GitVersion
|
|
|
|
id: gitversion
|
|
|
|
uses: gittools/actions/gitversion/execute@v1.1.1
|
2024-10-01 23:18:55 -04:00
|
|
|
with:
|
|
|
|
useConfigFile: true
|
|
|
|
configFilePath: GitVersion.yml
|
|
|
|
|
2025-02-24 09:14:30 +00:00
|
|
|
- name: Tag repository
|
|
|
|
run: |
|
|
|
|
git tag ${{ steps.gitversion.outputs.SemVer }}
|
|
|
|
git push origin ${{ steps.gitversion.outputs.SemVer }}
|
|
|
|
|
|
|
|
- name: Update package version
|
2024-10-01 23:18:55 -04:00
|
|
|
uses: vers-one/dotnet-project-version-updater@v1.6
|
|
|
|
with:
|
2024-10-01 23:20:53 -04:00
|
|
|
file: "./meilisearch.NET/meilisearch.NET.csproj"
|
2025-02-24 09:14:30 +00:00
|
|
|
version: ${{ steps.gitversion.outputs.SemVer }}
|
2024-10-01 23:18:55 -04:00
|
|
|
|
2025-02-24 09:14:30 +00:00
|
|
|
- name: Build and package
|
|
|
|
run: |
|
|
|
|
dotnet build --configuration Release
|
|
|
|
dotnet pack ./meilisearch.NET/meilisearch.NET.csproj --output nuget-packages --configuration Release -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
|
|
|
|
|
|
|
|
- name: Publish package to NuGet registry
|
|
|
|
run: |
|
|
|
|
dotnet nuget push nuget-packages/*.nupkg --skip-duplicate -s "https://git.d4m13n.dev/api/packages/damien/nuget/index.json" --api-key ${{ secrets.PACKAGE_TOKEN }}
|
|
|
|
|
|
|
|
- name: Create GitHub Release
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
|
|
|
tag_name: ${{ steps.gitversion.outputs.SemVer }}
|
|
|
|
name: Release ${{ steps.gitversion.outputs.SemVer }}
|
|
|
|
body: "https://git.d4m13n.dev/damien/meilisearch.NET/packages
|
|
|
|
Automated release of MeiliSearch.NET version ${{ steps.gitversion.outputs.SemVer }}."
|
|
|
|
files: nuget-packages/*.nupkg
|
|
|
|
draft: false
|
2025-03-01 14:42:26 -05:00
|
|
|
prerelease: true
|
|
|
|
run-tests:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
DOTNET_INSTALL_DIR: "/home/runner"
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
packages: write
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Cleanup build folder
|
|
|
|
run: |
|
|
|
|
rm -rf ./* ./.??* || true
|
|
|
|
|
|
|
|
- name: Set up .NET
|
|
|
|
uses: actions/setup-dotnet@v3
|
|
|
|
with:
|
|
|
|
dotnet-version: 8.0.x
|
|
|
|
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Run Tests
|
|
|
|
run: |
|
|
|
|
dotnet test ./meilisearch.NET.Tests/meilisearch.NET.Tests.csproj
|