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
5 changes: 1 addition & 4 deletions .github/workflows/build-datebadge-task.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: Build BYOB date badge task

env:
IS_MAIN_BRANCH: ${{ endsWith(github.ref, 'refs/heads/main') }}

on:
workflow_call:

Expand All @@ -20,7 +17,7 @@ jobs:
echo "date=$(date)" >> $GITHUB_OUTPUT

- name: Build BYOB date badge step
if: ${{ env.IS_MAIN_BRANCH == 'true' }}
if: ${{ github.ref_name == 'main' }}
uses: RubbaBoy/BYOB@v1
with:
name: lastbuild
Expand Down
19 changes: 6 additions & 13 deletions .github/workflows/build-docker-task.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
name: Build Docker image task

env:
IS_MAIN_BRANCH: ${{ endsWith(github.ref, 'refs/heads/main') }}
DOCKER_REGISTRY: docker.io
DOCKER_TAG_PREFIX: docker.io/ptr727/projecttemplate
DOCKER_FILE: ./Docker/Dockerfile

on:
workflow_call:
inputs:
Expand Down Expand Up @@ -45,7 +39,6 @@ jobs:
- name: Login to Docker Hub step
uses: docker/login-action@v3
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

Expand All @@ -54,16 +47,16 @@ jobs:
with:
context: .
push: ${{ inputs.push }}
file: ${{ env.DOCKER_FILE }}
file: ./Docker/Dockerfile
tags: |
${{ env.DOCKER_TAG_PREFIX }}:${{ env.IS_MAIN_BRANCH == 'true' && 'latest' || 'develop' }}
${{ env.DOCKER_TAG_PREFIX }}:${{ needs.get-version.outputs.SemVer2 }}
docker.io/ptr727/projecttemplate:${{ github.ref_name == 'main' && 'latest' || 'develop' }}
docker.io/ptr727/projecttemplate:${{ needs.get-version.outputs.SemVer2 }}
platforms: linux/amd64,linux/arm64
cache-from: type=registry,ref=${{ env.DOCKER_TAG_PREFIX }}:buildcache
cache-to: type=registry,ref=${{ env.DOCKER_TAG_PREFIX }}:buildcache,mode=max
cache-from: type=registry,ref=docker.io/ptr727/projecttemplate:buildcache
cache-to: type=registry,ref=docker.io/ptr727/projecttemplate:buildcache,mode=max
build-args: |
LABEL_VERSION=${{ needs.get-version.outputs.SemVer2 }}
BUILD_CONFIGURATION=${{ env.IS_MAIN_BRANCH == 'true' && 'Release' || 'Debug' }}
BUILD_CONFIGURATION=${{ github.ref_name == 'main' && 'Release' || 'Debug' }}
BUILD_VERSION=${{ needs.get-version.outputs.AssemblyVersion }}
BUILD_FILE_VERSION=${{ needs.get-version.outputs.AssemblyFileVersion }}
BUILD_ASSEMBLY_VERSION=${{ needs.get-version.outputs.AssemblyFileVersion }}
Expand Down
29 changes: 12 additions & 17 deletions .github/workflows/build-executable-task.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
name: Build executable task

env:
IS_MAIN_BRANCH: ${{ endsWith(github.ref, 'refs/heads/main') }}
PROJECT_FILE: ./Console/Console.csproj
PROJECT_ARTIFACT: Console.7z

on:
workflow_call:
outputs:
Expand Down Expand Up @@ -38,16 +33,16 @@ jobs:
uses: actions/checkout@v6

- name: Build executable project step
run: >-
dotnet publish ${{ env.PROJECT_FILE }}
--runtime ${{ matrix.runtime }}
--output ${{ runner.temp }}/publish/${{ matrix.runtime }}
--configuration ${{ env.IS_MAIN_BRANCH == 'true' && 'Release' || 'Debug' }}
-property:PublishAot=false
-property:Version=${{ needs.get-version.outputs.AssemblyVersion }}
-property:FileVersion=${{ needs.get-version.outputs.AssemblyFileVersion }}
-property:AssemblyVersion=${{ needs.get-version.outputs.AssemblyVersion }}
-property:InformationalVersion=${{ needs.get-version.outputs.AssemblyInformationalVersion }}
run: |
dotnet publish ./Console/Console.csproj \
--runtime ${{ matrix.runtime }} \
--output ${{ runner.temp }}/publish/${{ matrix.runtime }} \
--configuration ${{ github.ref_name == 'main' && 'Release' || 'Debug' }} \
-property:PublishAot=false \
-property:Version=${{ needs.get-version.outputs.AssemblyVersion }} \
-property:FileVersion=${{ needs.get-version.outputs.AssemblyFileVersion }} \
-property:AssemblyVersion=${{ needs.get-version.outputs.AssemblyVersion }} \
-property:InformationalVersion=${{ needs.get-version.outputs.AssemblyInformationalVersion }} \
-property:PackageVersion=${{ needs.get-version.outputs.SemVer2 }}

- name: Upload matrix build artifacts step
Expand All @@ -73,11 +68,11 @@ jobs:
path: ${{ runner.temp }}/publish

- name: Zip build output step
run: 7z a -t7z ${{ runner.temp }}/${{ env.PROJECT_ARTIFACT }} ${{ runner.temp }}/publish/*
run: 7z a -t7z ${{ runner.temp }}/Console.7z ${{ runner.temp }}/publish/*

- name: Upload build artifacts step
id: artifact-upload-step
uses: actions/upload-artifact@v6
with:
name: executable-build
path: ${{ runner.temp }}/${{ env.PROJECT_ARTIFACT }}
path: ${{ runner.temp }}/Console.7z
35 changes: 15 additions & 20 deletions .github/workflows/build-library-task.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
name: Build library task

env:
IS_MAIN_BRANCH: ${{ endsWith(github.ref, 'refs/heads/main') }}
PROJECT_FILE: ./Library/Library.csproj
PROJECT_ARTIFACT: Library.7z

on:
workflow_call:
inputs:
Expand Down Expand Up @@ -43,31 +38,31 @@ jobs:
uses: actions/checkout@v6

- name: Build library project step
run: >-
dotnet build ${{ env.PROJECT_FILE }}
--output ${{ runner.temp }}/publish
--configuration ${{ env.IS_MAIN_BRANCH == 'true' && 'Release' || 'Debug' }}
-property:Version=${{ needs.get-version.outputs.AssemblyVersion }}
-property:FileVersion=${{ needs.get-version.outputs.AssemblyFileVersion }}
-property:AssemblyVersion=${{ needs.get-version.outputs.AssemblyVersion }}
-property:InformationalVersion=${{ needs.get-version.outputs.AssemblyInformationalVersion }}
-property:PackageVersion=${{ needs.get-version.outputs.SemVer2 }}
run: |
dotnet build ./Library/Library.csproj \
--output ${{ runner.temp }}/publish \
--configuration ${{ github.ref_name == 'main' && 'Release' || 'Debug' }} \
-property:Version=${{ needs.get-version.outputs.AssemblyVersion }} \
-property:FileVersion=${{ needs.get-version.outputs.AssemblyFileVersion }} \
-property:AssemblyVersion=${{ needs.get-version.outputs.AssemblyVersion }} \
-property:InformationalVersion=${{ needs.get-version.outputs.AssemblyInformationalVersion }} \
-property:PackageVersion=${{ needs.get-version.outputs.SemVer2 }}

- name: Publish to NuGet.org step
if: ${{ inputs.push }}
run: >-
dotnet nuget push ${{ runner.temp }}/publish/*.nupkg
--source https://api.nuget.org/v3/index.json
--api-key ${{ secrets.NUGET_API_KEY }}
run: |
dotnet nuget push ${{ runner.temp }}/publish/*.nupkg \
--source https://api.nuget.org/v3/index.json \
--api-key ${{ secrets.NUGET_API_KEY }} \
--skip-duplicate

- name: Zip output step
run: |
7z a -t7z ${{ runner.temp }}/${{ env.PROJECT_ARTIFACT }} ${{ runner.temp }}/publish/*
7z a -t7z ${{ runner.temp }}/Library.7z ${{ runner.temp }}/publish/*

- name: Upload build artifacts step
id: artifact-upload-step
uses: actions/upload-artifact@v6
with:
name: library-build
path: ${{ runner.temp }}/${{ env.PROJECT_ARTIFACT }}
path: ${{ runner.temp }}/Library.7z
5 changes: 1 addition & 4 deletions .github/workflows/build-release-task.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: Build project release task

env:
IS_MAIN_BRANCH: ${{ endsWith(github.ref, 'refs/heads/main') }}

on:
workflow_call:
inputs:
Expand Down Expand Up @@ -78,7 +75,7 @@ jobs:
with:
generate_release_notes: true
tag_name: ${{ needs.get-version.outputs.SemVer2 }}
prerelease: ${{ env.IS_MAIN_BRANCH != 'true' }}
prerelease: ${{ github.ref_name != 'main' }}
files: |
LICENSE
README.md
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Test pull request action

on:
pull_request:
branches: [ main, develop ]
branches: [ main, develop, codegen ]
workflow_dispatch:

concurrency:
Expand Down