-
-
Notifications
You must be signed in to change notification settings - Fork 58
92 lines (82 loc) · 2.76 KB
/
Copy pathbuild-executable.yml
File metadata and controls
92 lines (82 loc) · 2.76 KB
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
82
83
84
85
86
87
88
89
90
91
92
name: Build Executable
on:
workflow_call:
inputs:
semVer:
required: true
type: string
nugetVer:
required: true
type: string
asmVer:
required: true
type: string
infoVer:
required: true
type: string
outputs:
artifact-run-id:
description: Run ID that published the artifacts
value: ${{ jobs.build-executable.outputs.artifact-run-id }}
jobs:
build-executable:
runs-on: ubuntu-latest
outputs:
artifact-run-id: ${{ steps.run-id.outputs.run-id }}
strategy:
matrix:
rid: [ linux_x64, win_x64, osx_x64, osx_arm64 ]
standalone: [ true, false ]
steps:
- name: Set artifact run id
id: run-id
run: echo "run-id=${{ github.run_id }}" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v7
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
global-json-file: global.json
- name: Restore
run: |
chmod +x build.sh
./build.sh restore --runtime ${{ matrix.rid }}
- name: Publish
run: |
./build.sh publish \
--self-contained ${{ matrix.standalone }} \
--runtime ${{ matrix.rid }} \
--skip restore \
--version ${{ inputs.nugetVer }} \
--assembly-version ${{ inputs.asmVer }} \
--informational-version ${{ inputs.infoVer }}
- name: Store Metadata
run: |
cd output/Beutl
ASSET_METADATA_ID=`uuidgen`
ASSET_METADATA_OS=`echo ${{ matrix.rid }} | cut -d '_' -f 1`
ASSET_METADATA_ARCH=`echo ${{ matrix.rid }} | cut -d '_' -f 2`
ASSET_METADATA_VERSION=${{ inputs.semVer }}
ASSET_METADATA_STANDALONE=${{ matrix.standalone }}
ASSET_METADATA_TYPE=zip
echo '{}' | jq \
--arg id $ASSET_METADATA_ID \
--arg os $ASSET_METADATA_OS \
--arg arch $ASSET_METADATA_ARCH \
--arg version $ASSET_METADATA_VERSION \
--arg standalone $ASSET_METADATA_STANDALONE \
--arg type $ASSET_METADATA_TYPE \
'.id=$id | .os=$os | .arch=$arch | .version=$version | .standalone=$standalone | .type=$type' > asset_metadata.json
cat asset_metadata.json
- name: Zip
run: |
./build.sh zip \
--runtime ${{ matrix.rid }} \
--self-contained ${{ matrix.standalone }} \
--skip publish \
--version ${{ inputs.nugetVer }}
- name: Save
uses: actions/upload-artifact@v7
with:
name: beutl-${{ matrix.rid }}${{ matrix.standalone == true && '-standalone' || '' }}-${{ inputs.semVer }}
path: ./artifacts/*.zip