Update .gitea/workflows/build_test_publish.yml

This commit is contained in:
2026-02-11 22:03:30 +01:00
Unverified
parent a49f1bd378
commit 9fab59b20d

View File

@@ -8,11 +8,13 @@ on:
- "TimetableDesigner**" - "TimetableDesigner**"
jobs: jobs:
build_and_test: build_test_version:
name: Build and test name: Build, test and determine version
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v6 uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup .NET - name: Setup .NET
uses: actions/setup-dotnet@v4 uses: actions/setup-dotnet@v4
with: with:
@@ -23,18 +25,6 @@ jobs:
run: dotnet build --no-restore run: dotnet build --no-restore
- name: Test - name: Test
run: dotnet test run: dotnet test
determine_version:
name: Determine version
needs: build_and_test
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 10.0.x
- name: Setup GitVersion - name: Setup GitVersion
uses: gittools/actions/gitversion/setup@v4.2.0 uses: gittools/actions/gitversion/setup@v4.2.0
with: with:
@@ -45,10 +35,10 @@ jobs:
with: with:
configFilePath: ./.gitea/config/gitversion.yml configFilePath: ./.gitea/config/gitversion.yml
outputs: outputs:
version: ${{ steps.gitversion.outputs.SemVer }} version: ${{ steps.gitversion.outputs.SemVer }}
pack: pack:
name: Pack name: Pack
needs: determine_version needs: build_test_version
strategy: strategy:
matrix: matrix:
platform: [x64, x86] platform: [x64, x86]
@@ -60,13 +50,13 @@ jobs:
with: with:
dotnet-version: 7.0.x dotnet-version: 7.0.x
- name: Publish - name: Publish
run: dotnet publish -c Release -r win-${{ matrix.platform }} --self-contained true -p:PublishSingleFile=true -p:Version=${{needs.determine_version.outputs.version}} TimetableDesigner\\TimetableDesigner.csproj run: dotnet publish -c Release -r win-${{ matrix.platform }} --self-contained true -p:PublishSingleFile=true -p:Version=${{needs.build_test_version.outputs.version}} TimetableDesigner\\TimetableDesigner.csproj
- name: Create .ZIP archive - name: Create .ZIP archive
id: archive id: archive
uses: ksm2/archive-action@v1 uses: ksm2/archive-action@v1
with: with:
format: "zip" format: "zip"
name: timetable_designer_${{needs.determine_version.outputs.version}}_${{ matrix.platform }} name: timetable_designer_${{needs.build_test_version.outputs.version}}_${{ matrix.platform }}
root-directory: TimetableDesigner/bin/Release/net7.0-windows/win-${{ matrix.platform }} root-directory: TimetableDesigner/bin/Release/net7.0-windows/win-${{ matrix.platform }}
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
@@ -90,9 +80,9 @@ jobs:
- name: Create Release - name: Create Release
uses: akkuman/gitea-release-action@v1 uses: akkuman/gitea-release-action@v1
with: with:
tag_name: ${{needs.determine_version.outputs.version}} tag_name: ${{needs.build_test_version.outputs.version}}
name: ${{needs.determine_version.outputs.version}} name: ${{needs.build_test_version.outputs.version}}
files: |- files: |-
timetable_designer_${{needs.determine_version.outputs.version}}_x64.zip timetable_designer_${{needs.build_test_version.outputs.version}}_x64.zip
timetable_designer_${{needs.determine_version.outputs.version}}_x86.zip timetable_designer_${{needs.build_test_version.outputs.version}}_x86.zip