-
-
Notifications
You must be signed in to change notification settings - Fork 505
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9936d83
commit f6e9516
Showing
2 changed files
with
74 additions
and
17 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
on: | ||
push: | ||
tags: | ||
- "v[0-9]+.[0-9]+.[0-9]+" | ||
env: | ||
# Stop wasting time caching packages | ||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | ||
# Disable sending usage data to Microsoft | ||
DOTNET_CLI_TELEMETRY_OPTOUT: true | ||
|
||
# MYSQL DB | ||
DB_MYSQL_DATABASE: test_sqlkata | ||
DB_MYSQL_USER: root | ||
DB_MYSQL_PASSWORD: "root" | ||
DB_MYSQL_HOST: localhost | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Verify commit exists in origin/main | ||
run: git branch --remote --contains | grep origin/main | ||
# - name: Extract release notes | ||
# run: | | ||
# git log --pretty=format:'%d %s' ${GITHUB_REF} | perl -pe 's| \(.*tag: v(\d+.\d+.\d+(-preview\d{3})?)(, .*?)*\)|\n## \1\n|g' > RELEASE-NOTES | ||
- name: Set VERSION variable from tag | ||
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV | ||
- name: Build | ||
run: dotnet build --configuration Release /p:Version=${VERSION} | ||
- name: Start MySql | ||
run: | | ||
sudo /etc/init.d/mysql start | ||
mysqladmin -u ${{ env.DB_MYSQL_USER }} -p${{ env.DB_MYSQL_PASSWORD }} password '' | ||
mysql -e 'CREATE DATABASE ${{ env.DB_MYSQL_DATABASE }};' -u${{ env.DB_MYSQL_USER }} | ||
mysql -e 'CREATE TABLE cars(id int primary key auto_increment);' -u${{ env.DB_MYSQL_USER }} ${{ env.DB_MYSQL_DATABASE }} | ||
mysql -e 'SHOW TABLES;' -u${{ env.DB_MYSQL_USER }} ${{ env.DB_MYSQL_DATABASE }} | ||
- name: Test | ||
run: dotnet test --configuration Release /p:Version=${VERSION} --no-build | ||
env: | ||
SQLKATA_MYSQL_HOST: ${{ env.DB_MYSQL_HOST }} | ||
SQLKATA_MYSQL_USER: ${{ env.DB_MYSQL_USER }} | ||
SQLKATA_MYSQL_DB: ${{ env.DB_MYSQL_DATABASE }} | ||
- name: Pack | ||
run: dotnet pack --configuration Release /p:Version=${VERSION} --no-build --output . | ||
- name: Push | ||
run: dotnet nuget push *.${VERSION}.nupkg --source https://nuget.pkg.github.com/sqlkata/index.json --api-key ${GITHUB_TOKEN} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,24 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFrameworks>net8.0</TargetFrameworks> | ||
<OutputType>Library</OutputType> | ||
<IsPackable>false</IsPackable> | ||
<RootNamespace>SqlKata.Tests</RootNamespace> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Data.Sqlite" Version="6.0.8" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.0" /> | ||
<PackageReference Include="MySql.Data" Version="8.0.30" /> | ||
<PackageReference Include="xunit" Version="2.3.1" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\QueryBuilder\QueryBuilder.csproj" /> | ||
<ProjectReference Include="..\SqlKata.Execution\SqlKata.Execution.csproj" /> | ||
</ItemGroup> | ||
<PropertyGroup> | ||
<TargetFrameworks>net8.0</TargetFrameworks> | ||
<OutputType>Library</OutputType> | ||
<IsPackable>false</IsPackable> | ||
<RootNamespace>SqlKata.Tests</RootNamespace> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Data.Sqlite" | ||
Version="9.0.1" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" | ||
Version="17.12.0" /> | ||
<PackageReference Include="MySql.Data" | ||
Version="8.0.30" /> | ||
<PackageReference Include="xunit" | ||
Version="2.9.3" /> | ||
<PackageReference Include="xunit.runner.visualstudio" | ||
Version="3.0.1" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\QueryBuilder\QueryBuilder.csproj" /> | ||
<ProjectReference Include="..\SqlKata.Execution\SqlKata.Execution.csproj" /> | ||
</ItemGroup> | ||
</Project> |