Skip to content

Commit c64fa45

Browse files
Polish workflows (#135)
* Polish GitHub workflows * Fix release workflow dependencies
1 parent 45a91d8 commit c64fa45

4 files changed

Lines changed: 16 additions & 17 deletions

File tree

.github/actions/build-and-test/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ runs:
1717

1818
- name: Test
1919
shell: bash
20-
run: dotnet test -c Release --no-build --logger trx --results-directory TestResults
20+
run: dotnet test -c Release --no-build --no-restore --logger trx --results-directory TestResults

.github/actions/create-release-artifacts/action.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,16 @@ runs:
1515
steps:
1616
- uses: actions/setup-dotnet@v5
1717

18-
- name: Create Binaries
18+
- name: Create binaries
1919
shell: bash
2020
run: |
21-
arch="${{ inputs.arch }}"
2221
dotnet tool install --global wix --version 4.0.6
23-
dotnet publish ./DesktopClock/DesktopClock.csproj -o "publish/$arch" -c Release --os win --arch "$arch" -p:Version=${{ inputs.version }}
24-
wix build Product.wxs -d MainExeSource="publish/$arch/DesktopClock.exe" -o "publish/DesktopClock-${{ inputs.version }}-$arch.msi"
22+
dotnet publish ./DesktopClock/DesktopClock.csproj -o "publish/${{ inputs.arch }}" -c Release --os win --arch "${{ inputs.arch }}" -p:Version="${{ inputs.version }}"
23+
wix build Product.wxs -d "MainExeSource=publish/${{ inputs.arch }}/DesktopClock.exe" -o "publish/DesktopClock-${{ inputs.version }}-${{ inputs.arch }}.msi"
2524
26-
- name: Create Portable ZIP
25+
- name: Create portable ZIP
2726
shell: pwsh
28-
run: |
29-
$arch = "${{ inputs.arch }}"
30-
Compress-Archive -Path "publish/$arch/DesktopClock.exe" -DestinationPath "publish/DesktopClock-${{ inputs.version }}-$arch.zip"
27+
run: Compress-Archive -Path "publish/${{ inputs.arch }}/DesktopClock.exe" -DestinationPath "publish/DesktopClock-${{ inputs.version }}-${{ inputs.arch }}.zip" -Force
3128

3229
- uses: actions/upload-artifact@v7
3330
with:

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
name: Format
1414
runs-on: windows-2025
1515
steps:
16-
- uses: actions/checkout@v5
16+
- uses: actions/checkout@v6
1717

1818
- uses: actions/setup-dotnet@v5
1919

@@ -29,7 +29,7 @@ jobs:
2929
name: Build and test
3030
runs-on: windows-2025
3131
steps:
32-
- uses: actions/checkout@v5
32+
- uses: actions/checkout@v6
3333

3434
- uses: ./.github/actions/build-and-test
3535

@@ -49,7 +49,7 @@ jobs:
4949
matrix:
5050
arch: [x64, arm64]
5151
steps:
52-
- uses: actions/checkout@v5
52+
- uses: actions/checkout@v6
5353

5454
- uses: ./.github/actions/create-release-artifacts
5555
with:

.github/workflows/deploy.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ on:
1919
default: true
2020

2121
permissions:
22-
contents: write
22+
contents: read
2323

2424
jobs:
2525
build-test:
2626
name: Build and test
2727
runs-on: windows-2025
2828
steps:
29-
- uses: actions/checkout@v5
29+
- uses: actions/checkout@v6
3030

3131
- uses: ./.github/actions/build-and-test
3232

@@ -38,7 +38,7 @@ jobs:
3838
matrix:
3939
arch: [x64, arm64]
4040
steps:
41-
- uses: actions/checkout@v5
41+
- uses: actions/checkout@v6
4242

4343
- uses: ./.github/actions/create-release-artifacts
4444
with:
@@ -50,7 +50,9 @@ jobs:
5050
needs:
5151
- build-test
5252
- package
53-
runs-on: windows-2025
53+
runs-on: ubuntu-24.04
54+
permissions:
55+
contents: write
5456
steps:
5557
- uses: actions/download-artifact@v8
5658
with:
@@ -65,7 +67,7 @@ jobs:
6567
tag: "v${{ inputs.version }}"
6668
artifacts: "release-artifacts/*.zip,release-artifacts/*.msi"
6769
generateReleaseNotes: true
68-
prerelease: ${{ contains(inputs.version, 'preview') }}
70+
prerelease: ${{ contains(inputs.version, '-') }}
6971
allowUpdates: ${{ inputs.updateRelease }}
7072
removeArtifacts: true
7173
omitBodyDuringUpdate: true

0 commit comments

Comments
 (0)