Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Commit

Permalink
split pack template into feature and main workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
kurmann committed Apr 11, 2024
1 parent 5b44f7b commit b685097
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 47 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/pack-feature-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Pack Feature .NET Template

on:
workflow_run:
workflows: ["Set Version"]
branches-ignore:
- main
types:
- completed

jobs:
pack-feature:
runs-on: ubuntu-latest
env:
PROJECT_FILE: Templates.csproj
BASE_VERSION: '1.0.0' # Wird dynamisch überschrieben

steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Restore NuGet packages
run: dotnet restore ${{ env.PROJECT_FILE }}
- name: Pack .NET Template Project for Feature Branches
run: |
datetimeSuffix=$(date +"%Y%m%d%H%M")
version="${{ env.BASE_VERSION }}-preview.$datetimeSuffix"
dotnet pack ${{ env.PROJECT_FILE }} /p:PackageVersion=$version --configuration Release --output nupkg
echo "Feature branch version is $version"
26 changes: 26 additions & 0 deletions .github/workflows/pack-main-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Pack Main .NET Template

on:
workflow_run:
workflows: ["Set Version"]
branches:
- main
types:
- completed

jobs:
pack-main:
runs-on: ubuntu-latest
env:
PROJECT_FILE: Templates.csproj

steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Restore NuGet packages
run: dotnet restore ${{ env.PROJECT_FILE }}
- name: Pack .NET Template Project for Main
run: dotnet pack ${{ env.PROJECT_FILE }} --configuration Release --output nupkg
47 changes: 0 additions & 47 deletions .github/workflows/pack-template.yml

This file was deleted.

0 comments on commit b685097

Please sign in to comment.