Skip to content

Merge pull request #14 from Hekku2/feat/release-fix #10

Merge pull request #14 from Hekku2/feat/release-fix

Merge pull request #14 from Hekku2/feat/release-fix #10

Workflow file for this run

name: Build and Test code
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
# Needed for release creation
contents: write
jobs:
build:
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 }}
title: Release ${{ github.run_number }}
body: |
Release ${{ github.run_number }}
generate_release_notes: true
make_latest: true