Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@ name: Build and deploy ASP.Net Core app to Azure Web App - sample-trigger
on:
push:
branches:
- feature/update-samples-and-documentation
- feature/deploy-sample-project
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Checkout Repository
uses: actions/checkout@v4
with:
sparse-checkout: samples

- name: Set up .NET Core
uses: actions/setup-dotnet@v1
Expand All @@ -31,14 +34,14 @@ jobs:
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v3
with:
name: .net-app
name: sample-app
path: ${{env.DOTNET_ROOT}}/myapp

deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'Production'
name: 'Development'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
permissions:
id-token: write #This is required for requesting the JWT
Expand All @@ -47,7 +50,7 @@ jobs:
- name: Download artifact from build job
uses: actions/download-artifact@v3
with:
name: .net-app
name: sample-app

- name: Login to Azure
uses: azure/login@v1
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/dotnet-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,25 @@ name: Package Release
run-name: Release ${{ github.ref_name }}

on:
release:
types: [published]
push:
tags:
- '[0-1].[0-9]+.[0-9]+' # '0.1.1', '0.14.23'
- '[0-1].[0-9]+.[0-9]+-alpha[0-9]?[0-9]?' # '0.14.23-alpha', '1.14.23-alpha1', '1.14.23-alpha23'
- '[0-1].[0-9]+.[0-9]+-beta[0-9]?[0-9]?' # '0.14.23-beta', '1.14.23-beta1', '1.14.23-beta23'
- '[0-1].[0-9]+.[0-9]+-rc[0-9]?[0-9]?' # '0.14.23-rc', '1.14.23-rc1', '1.14.23-rc23'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
publish_nuget:
if: github.event.release.draft == false
name: Publish NuGet packages
uses: ./.github/workflows/wf-publish-nuget.yaml
permissions:
packages: write
with:
push_package_to_nuget: ${{ github.event.release.prerelease == false }}
push_package_to_nuget: true
version: ${{ github.ref_name }}
secrets:
nuget_api_key: ${{ secrets.NUGET_API_KEY_TEST }}
10 changes: 9 additions & 1 deletion .github/workflows/wf-publish-nuget.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
description: 'Version Suffix'
type: string
default: ''
version:
description: 'Version'
type: string
default: ''
secrets:
nuget_api_key:
description: 'NuGet API Key'
Expand All @@ -39,8 +43,12 @@ jobs:
- name: Create packages directory
run: mkdir -p packages

- name: Define optional Package Version
id: optional_parameter
run: echo "packVersion=${{ inputs.version != '' && format('-p:PackageVersion=''{0}''', github.ref_name) || '' }}" >> $GITHUB_OUTPUT

- name: Pack
run: dotnet pack $GITHUB_WORKSPACE/src/InvvardDev.Ifttt.csproj --version-suffix '${{ inputs.version_suffix }}' --output $PACKAGE_DIR_NAME --configuration ${{ inputs.build_configuration }} -p:GeneratePackageOnBuild=false
run: dotnet pack $GITHUB_WORKSPACE/src/InvvardDev.Ifttt.csproj --version-suffix '${{ inputs.version_suffix }}' --output $PACKAGE_DIR_NAME --configuration ${{ inputs.build_configuration }} -p:GeneratePackageOnBuild=false ${{ steps.optional_parameter.outputs.packVersion }}

- name: Upload Artifact
uses: actions/upload-artifact@v4
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/wf-tester.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Workflow Tester
run-name: Workflow Tester

on:
push:
tags:
- '[0-1].[0-9]+.[0-9]+' # '0.1.1', '0.14.23'
- '[0-1].[0-9]+.[0-9]+-alpha[0-9]?[0-9]?' # '0.14.23-alpha', '1.14.23-alpha1', '1.14.23-alpha23'
- '[0-1].[0-9]+.[0-9]+-beta[0-9]?[0-9]?' # '0.14.23-beta', '1.14.23-beta1', '1.14.23-beta23'
- '[0-1].[0-9]+.[0-9]+-rc[0-9]?[0-9]?' # '0.14.23-rc', '1.14.23-rc1', '1.14.23-rc23'

jobs:
test_workflows:
name: Test Workflows
runs-on: ubuntu-latest

steps:
- name: Output tag name
run: |
echo "Tag name: ${{ github.ref_name }}"

- name: Checkout Repository
uses: actions/checkout@v4
with:
sparse-checkout: src

- name: Create packages directory
run: mkdir -p packages

- name: Define optional Package Version
id: optional_parameter
run: echo "packVersion=${{ contains(github.ref_name, 'alpha') && format('-p:PackageVersion=''{0}''', github.ref_name) || '' }}" >> $GITHUB_OUTPUT

- name: Pack
run: dotnet pack $GITHUB_WORKSPACE/src/InvvardDev.Ifttt.csproj ${{ steps.optional_parameter.outputs.packVersion }}