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
8 changes: 2 additions & 6 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 @@ -16,11 +13,10 @@ jobs:

- name: Get current date step
id: date
run: |
echo "date=$(date)" >> $GITHUB_OUTPUT
run: 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
53 changes: 24 additions & 29 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 @@ -65,19 +60,19 @@ jobs:

steps:

- name: Download matrix build artifacts step
uses: actions/download-artifact@v7
with:
pattern: publish-*
merge-multiple: true
path: ${{ runner.temp }}/publish
- name: Download matrix build artifacts step
uses: actions/download-artifact@v7
with:
pattern: publish-*
merge-multiple: true
path: ${{ runner.temp }}/publish

- name: Zip build output step
run: 7z a -t7z ${{ runner.temp }}/${{ env.PROJECT_ARTIFACT }} ${{ runner.temp }}/publish/*
- name: Zip build output step
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 }}
- name: Upload build artifacts step
id: artifact-upload-step
uses: actions/upload-artifact@v6
with:
name: executable-build
path: ${{ runner.temp }}/Console.7z
36 changes: 15 additions & 21 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,30 @@ 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/*
run: 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
6 changes: 3 additions & 3 deletions .github/workflows/merge-bot-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ jobs:

- name: Merge pull request step
if: steps.metadata.outputs.update-type != 'version-update:semver-major'
run: gh pr merge --auto --merge "$PR_URL"
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

merge-codegen:
name: Merge codegen pull request job
runs-on: ubuntu-latest
if: github.actor == 'github-actions[bot]' && github.event.pull_request.head.ref == 'codegen-update' && github.event.pull_request.head.repo.full_name == github.repository
if: github.actor == 'github-actions[bot]' && github.event.pull_request.head.ref == 'codegen' && github.event.pull_request.head.repo.full_name == github.repository
permissions:
contents: write
pull-requests: write

steps:

- name: Merge pull request step
run: gh pr merge --auto --merge "$PR_URL"
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
10 changes: 4 additions & 6 deletions .github/workflows/run-codegen-pull-request-task.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: Run codegen and pull request task

env:
PROJECT_FILE: ./CodeGen/CodeGen.csproj

on:
workflow_call:

Expand All @@ -23,8 +20,8 @@ jobs:
uses: actions/checkout@v6

- name: Run codegen step
run: >-
dotnet run --project ${{ env.PROJECT_FILE }} --
run: |
dotnet run --project ./CodeGen/CodeGen.csproj -- \
--codepath ./CodeGen

- name: Format code step
Expand All @@ -37,8 +34,9 @@ jobs:
- name: Create pull request step
uses: peter-evans/create-pull-request@v8
with:
branch: codegen-update
branch: codegen
title: 'Update codegen files'
body: 'This PR updates the codegen files.'
commit-message: 'Update codegen files'
delete-branch: true
sign-commits: true
Comment thread
ptr727 marked this conversation as resolved.
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
Loading