Add durable functions for faster response time (#22) #27
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: Build and Test code | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
# Needed for release creation | |
contents: write | |
jobs: | |
build: | |
name: Build, Test and Release code | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore | |
- name: Test | |
run: dotnet test --no-build --verbosity normal | |
- name: Package | |
id: package-zip | |
shell: pwsh | |
run: | | |
$archivePath = Join-Path -Path (Resolve-Path ".\").Path -ChildPath 'publish.zip' | |
./scripts/Build-Backend.ps1 -ZipPath $archivePath | |
echo "ARTIFACT_LOCATION=$archivePath" >> $env:GITHUB_OUTPUT | |
- name: Upload artifacts | |
env: | |
ARTIFACT_LOCATION: ${{ steps.package-zip.outputs.ARTIFACT_LOCATION }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: DiscordImageSender | |
path: ${{ env.ARTIFACT_LOCATION }} | |
- name: Create release | |
uses: softprops/action-gh-release@v2 | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
with: | |
files: | | |
${{ steps.package-zip.outputs.ARTIFACT_LOCATION }} | |
tag_name: v${{ github.run_number }} | |
body: | | |
Release ${{ github.run_number }} | |
generate_release_notes: true | |
make_latest: true |