Skip to content

Bind SQLite timestamp parameters as the exact stored text #213

Bind SQLite timestamp parameters as the exact stored text

Bind SQLite timestamp parameters as the exact stored text #213

Workflow file for this run

name: Build NuGet packages
on:
push:
branches: [ develop, main ]
tags:
- v*
pull_request:
branches: [ develop, main ]
jobs:
build:
permissions:
packages: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# We use `git describe` to find tags in commit history, so we need complete repo history
fetch-depth: 0
- name: Calculate version number for PR build
if: github.event_name == 'pull_request'
shell: bash
run: src/calculate-version.sh "${{ github.run_number }}" "${{ github.event.number }}"
- name: Calculate version number for non-PR build
if: github.event_name != 'pull_request'
shell: bash
run: src/calculate-version.sh "${{ github.run_number }}"
- name: Install .NET
uses: actions/setup-dotnet@v4
- name: Build & test
run: dotnet test --configuration Release --logger GitHubActions
- name: Pack
shell: bash
run: |
dotnet pack /p:PackageVersion="$PACKAGE_VERSION" /p:AssemblyVersion="$ASSEMBLY_VERSION" /p:FileVersion="$FILE_VERSION"
- name: Upload packages to build artifacts
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: src/artifacts/package/release/*nupkg
- name: Publish package to NuGet.org
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
shell: bash
run: |
shopt -s nullglob
packages=(src/artifacts/package/release/*.nupkg)
symbols=(src/artifacts/package/release/*.snupkg)
if ((${#packages[@]} == 0)); then
echo "No NuGet packages were produced." >&2
exit 1
fi
if ((${#symbols[@]} == 0)); then
echo "No symbol packages were produced." >&2
exit 1
fi
for pkg in "${packages[@]}"; do
case "$pkg" in
*.symbols.nupkg|*.snupkg) continue ;;
esac
echo "Publishing $pkg"
dotnet nuget push "$pkg" \
--skip-duplicate \
--api-key "$NUGET_API_KEY" \
--source https://api.nuget.org/v3/index.json
done
for sym in "${symbols[@]}"; do
echo "Publishing symbols $sym"
dotnet nuget push "$sym" \
--skip-duplicate \
--api-key "$NUGET_API_KEY" \
--source https://api.nuget.org/v3/index.json
done
env:
NUGET_API_KEY: ${{ secrets.SILLSDEV_PUBLISH_NUGET_ORG }}