Skip to content

Mark version 1.0.92 as released (#87) #93

Mark version 1.0.92 as released (#87)

Mark version 1.0.92 as released (#87) #93

Workflow file for this run

name: Pre-release
on:
push:
branches:
- main
workflow_dispatch:
env:
AZURE_FUNCTIONAPP_PACKAGE_PATH: "."
AZURE_FUNCTIONAPP_NAME: "geodatenbezug"
AZURE_FUNCTIONAPP_SLOT: "production"
DOTNET_VERSION: "8.0.x"
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build-and-deploy:
runs-on: windows-latest
permissions:
id-token: write
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set environment variables
shell: pwsh
run: |
$versionPrefix = Select-String -Path Directory.Build.props -Pattern '(?<=<VersionPrefix>)[^<]+' -AllMatches | ForEach-Object { $_.Matches } | ForEach-Object { $_.Value }
$version = "$versionPrefix.$env:GITHUB_RUN_NUMBER"
echo "VERSION=$version" | Out-File -Encoding utf8 -Append -FilePath $env:GITHUB_ENV
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build solution
shell: pwsh
run: |
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
dotnet build --configuration Release --output ./output
popd
- name: Login to Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_FC79ACD3493F4D6CB09C619860F15688 }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_DC41E352EF2D471992D5623CB1879E27 }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_28EB1A5320E2429ABBCF9298EB712AD3 }}
- name: Deploy Azure Function
uses: Azure/functions-action@v1
id: fa
with:
app-name: "${{ env.AZURE_FUNCTIONAPP_NAME }}"
slot-name: "${{ env.AZURE_FUNCTIONAPP_SLOT }}"
package: "${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/output"
- name: Create GitHub pre-release
shell: bash
run: |
gh api \
--method POST \
--header "Accept: application/vnd.github+json" \
repos/${GITHUB_REPOSITORY}/releases \
-f tag_name='v${{ env.VERSION }}' \
-f target_commitish='main' \
-f name='${{ env.VERSION }}' \
-F prerelease=true \