-
Notifications
You must be signed in to change notification settings - Fork 5
147 lines (127 loc) · 4.55 KB
/
build.yml
File metadata and controls
147 lines (127 loc) · 4.55 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Build
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: read
jobs:
build:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
permissions:
contents: read
security-events: write
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
egress-policy: audit
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v5.0.0
- name: Setup Python
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: '3.13'
- name: Set up Ruby
if: ${{ matrix.platform != 'windows-latest' }}
uses: ruby/setup-ruby@4c24fa5ec04b2e79eb40571b1cee2a0d2b705771 #v1.278.0
with:
ruby-version: 3.3 # See also devcontainer
- name: Install fpm
if: ${{ matrix.platform != 'windows-latest' }}
run: |
gem install --no-document fpm --version 1.17.0
fpm --version
- name: Add msbuild to PATH
if: ${{ matrix.platform == 'windows-latest' }}
uses: microsoft/setup-msbuild@767f00a3f09872d96a0cb9fcd5e6a4ff33311330 # v2
- name: Install WiX
if: ${{ matrix.platform == 'windows-latest' }}
run: |
dotnet tool install --global wix --version 6.0.2
echo "$env:USERPROFILE\.dotnet\tools" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
wix --version
- name: ccache
uses: hendrikmuhs/ccache-action@5ebbd400eff9e74630f759d94ddd7b6c26299639 # v1.2
if: ${{ matrix.platform != 'windows-latest' }}
with:
key: ${{ github.job }}-${{ matrix.platform }}
verbose: 1
create-symlink: true
- name: Setup cache for clcache
if: ${{ matrix.platform == 'windows-latest' }}
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: ${{ github.workspace }}\.clcache
key: ${{ github.job }}-${{ matrix.platform }}
- name: Create binary
env:
CCACHE_BASEDIR: ${{ github.workspace }}
CCACHE_NOHASHDIR: true
NUITKA_CACHE_DIR_CCACHE: ${{ github.workspace }}/.ccache
NUITKA_CACHE_DIR_CLCACHE: ${{ github.workspace }}\.clcache
NUITKA_CCACHE_BINARY: /usr/bin/ccache
run: |
pip install .[build]
python script/create_sbom.py
python script/build.py
python script/package.py
- name: Store the distribution packages
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: binary-distribution-${{ matrix.platform }}
path: |
build/dfetch-package/*.deb
build/dfetch-package/*.rpm
build/dfetch-package/*.pkg
build/dfetch-package/*.msi
build/dfetch-package/*.cdx.json
test-binary:
name: test binary
needs:
- build
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Download the binary artifact
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v5
with:
name: binary-distribution-${{ matrix.platform }}
path: .
- name: Install binary
if: matrix.platform == 'ubuntu-latest'
run: |
sudo dpkg -i dfetch*.deb
sudo dpkg -L dfetch
echo "/opt/dfetch" >> $GITHUB_PATH
shell: bash
- name: Install binary
if: matrix.platform == 'macos-latest'
run: |
sudo installer -pkg dfetch*.pkg -target / -verboseR
echo "/opt/dfetch/opt/dfetch" >> $GITHUB_PATH
shell: bash
- name: Install binary
if: matrix.platform == 'windows-latest'
run: |
$file = "dfetch.msi"
$log = "install.log"
$procMain = Start-Process "msiexec" "/i `"$file`" /qn /l*! `"$log`"" -NoNewWindow -PassThru
$procLog = Start-Process "powershell" "Get-Content -Path `"$log`" -Wait" -NoNewWindow -PassThru
$procMain.WaitForExit()
$procLog.Kill()
echo "C:\Program Files (x86)\dfetch" >> $env:GITHUB_PATH
shell: pwsh
- run: dfetch init
- run: dfetch environment
- run: dfetch validate
- run: dfetch check
- run: dfetch update
- run: dfetch update
- run: dfetch report -t sbom