-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (69 loc) · 2.11 KB
/
generate_executables.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Create Executables
on:
workflow_call:
inputs:
tag:
required: true
type: string
default: ${{ github.ref_name }}
description: The tag to use for the release
outputs:
assets:
description: The list of assets
value: ${{ jobs.publish-project.outputs.assets }}
workflow_run:
workflows: ["Draft Release"]
workflow_dispatch:
inputs:
tag:
description: 'Suffix zip folder'
required: false
type: string
default: 'latest'
jobs:
setup-environment:
name: Setup Environment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
publish-project:
runs-on: ${{ matrix.os }}
env:
tag: ${{ inputs.tag || github.ref_name }}
needs: setup-environment
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macOS-latest ]
steps:
- uses: actions/checkout@v4
- name: Publish
run: dotnet publish Resumer/ --output ./publish
- name: Zip Files
shell: pwsh
run: |
if ($env:RUNNER_OS -eq "Windows") {
mv ./publish/Resumer.exe ./publish/resumer.exe
7z a ./${{ matrix.os }}_resumer_${{ env.tag }}.zip '.\publish\*'
}
else {
mv ./publish/Resumer ./publish/resumer
cd ./publish
zip -1g ../${{ matrix.os }}_resumer_${{ env.tag }}.zip *
cd ..
}
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}_resumer_${{ env.tag }}
path: ${{ matrix.os }}_resumer_${{ env.tag }}.zip
- name: Set Output
id: set-output
run: |
echo "assets=${{ matrix.os }}_resumer_${{ env.tag }}.zip" >> $GITHUB_OUTPUT
outputs:
assets: ${{ steps.set-output.outputs.assets }}