fastfetch-sys 2.43.0

A neofetch like system information tool
Documentation
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
name: CI

on:
  - push
  - pull_request

jobs:
  spellcheck:
    runs-on: ubuntu-latest

    steps:
      - name: checkout repository
        uses: actions/checkout@v4

      - name: Install codespell
        shell: bash
        run: |
          sudo apt-get update || true
          sudo apt-get install -y codespell

      - name: Run Spellchecker
        run: codespell

  no-features-test:
    name: No-features-test
    runs-on: ubuntu-latest
    permissions:
      security-events: write
      contents: read
    steps:
      - name: checkout repository
        uses: actions/checkout@v4

      - name: uname -a
        run: uname -a

      - name: configure project
        run: cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr . -DENABLE_VULKAN=OFF -DENABLE_WAYLAND=OFF -DENABLE_XCB_RANDR=OFF -DENABLE_XCB=OFF -DENABLE_XRANDR=OFF -DENABLE_X11=OFF -DENABLE_DRM=OFF -DENABLE_DRM_AMDGPU=OFF -DENABLE_GIO=OFF -DENABLE_DCONF=OFF -DENABLE_DBUS=OFF -DENABLE_XFCONF=OFF -DENABLE_SQLITE3=OFF -DENABLE_RPM=OFF -DENABLE_IMAGEMAGICK7=OFF -DENABLE_IMAGEMAGICK6=OFF -DENABLE_CHAFA=OFF -DENABLE_ZLIB=OFF -DENABLE_EGL=OFF -DENABLE_GLX=OFF -DENABLE_OPENCL=OFF -DENABLE_FREETYPE=OFF -DENABLE_PULSE=OFF -DENABLE_DDCUTIL=OFF -DENABLE_ELF=OFF -DENABLE_DIRECTX_HEADERS=OFF -DENABLE_THREADS=OFF

      - name: build project
        run: cmake --build . --target package --verbose -j4

      - name: list features
        run: ./fastfetch --list-features

      - name: run fastfetch
        run: time ./fastfetch -c presets/ci.jsonc --stat false

      - name: run fastfetch --format json
        run: time ./fastfetch -c presets/ci.jsonc --format json

      - name: run flashfetch
        run: time ./flashfetch

      - name: print dependencies
        run: ldd fastfetch

      - name: run tests
        run: ctest --output-on-failure

  linux-amd64:
    name: Linux-amd64
    runs-on: ubuntu-22.04
    permissions:
      security-events: write
      contents: read
    outputs:
      ffversion: ${{ steps.ffversion.outputs.ffversion }}
    steps:
      - name: checkout repository
        uses: actions/checkout@v4

      - name: uname -a
        run: uname -a

      - name: cat /etc/os-release
        run: cat /etc/os-release

      - name: cat /proc/cpuinfo
        run: cat /proc/cpuinfo

      - name: install required packages
        run: sudo apt-get update && sudo apt-get install -y libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libelf-dev libddcutil-dev directx-headers-dev

      - name: install linuxbrew packages
        run: |
          /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
          /home/linuxbrew/.linuxbrew/bin/brew install imagemagick chafa --ignore-dependencies

      - name: Initialize CodeQL
        uses: github/codeql-action/init@v3
        with:
          languages: c

      - name: configure project
        run: PKG_CONFIG_PATH=/home/linuxbrew/.linuxbrew/lib/pkgconfig:$PKG_CONFIG_PATH cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=On -DENABLE_EMBEDDED_AMDGPUIDS=On -DCMAKE_INSTALL_PREFIX=/usr .

      - name: build project
        run: cmake --build . --target package --verbose -j4

      - name: perform CodeQL analysis
        uses: github/codeql-action/analyze@v3

      - name: list features
        run: ./fastfetch --list-features

      - name: run fastfetch
        run: time ./fastfetch -c presets/ci.jsonc --stat false

      - name: run fastfetch --format json
        run: time ./fastfetch -c presets/ci.jsonc --format json

      - name: run flashfetch
        run: time ./flashfetch

      - name: print dependencies
        run: ldd fastfetch

      - name: run tests
        run: ctest --output-on-failure

      - name: get fastfetch version
        id: ffversion
        run: echo "ffversion=$(./fastfetch --version-raw)" >> $GITHUB_OUTPUT

      - name: upload artifacts
        uses: actions/upload-artifact@v4
        with:
          name: fastfetch-linux-amd64
          path: ./fastfetch-*.*

  linux-aarch64:
    name: Linux-aarch64
    runs-on: ubuntu-22.04-arm
    permissions:
      security-events: write
      contents: read
    steps:
      - name: checkout repository
        uses: actions/checkout@v4

      - name: uname -a
        run: uname -a

      - name: cat /etc/os-release
        run: cat /etc/os-release

      - name: cat /proc/cpuinfo
        run: cat /proc/cpuinfo

      - name: install required packages
        run: sudo apt-get update && sudo apt-get install -y libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libelf-dev directx-headers-dev libchafa-dev libddcutil-dev rpm

      - name: install linuxbrew packages
        run: |
          /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
          /home/linuxbrew/.linuxbrew/bin/brew install imagemagick chafa --ignore-dependencies

      - name: configure project
        run: PKG_CONFIG_PATH=/home/linuxbrew/.linuxbrew/lib/pkgconfig:$PKG_CONFIG_PATH cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=On -DENABLE_EMBEDDED_AMDGPUIDS=On -DCMAKE_INSTALL_PREFIX=/usr .

      - name: build project
        run: cmake --build . --target package --verbose -j4

      - name: list features
        run: ./fastfetch --list-features

      - name: run fastfetch
        run: time ./fastfetch -c presets/ci.jsonc --stat false

      - name: run fastfetch --format json
        run: time ./fastfetch -c presets/ci.jsonc --format json

      - name: run flashfetch
        run: time ./flashfetch

      - name: print dependencies
        run: ldd fastfetch

      - name: run tests
        run: ctest --output-on-failure

      - name: get fastfetch version
        id: ffversion
        run: echo "ffversion=$(./fastfetch --version-raw)" >> $GITHUB_OUTPUT

      - name: upload artifacts
        uses: actions/upload-artifact@v4
        with:
          name: fastfetch-linux-aarch64
          path: ./fastfetch-*.*

  linux-armv7l:
    name: Linux-armv7l
    runs-on: ubuntu-24.04
    permissions:
      security-events: write
      contents: read
    steps:
      - name: checkout repository
        uses: actions/checkout@v4

      - name: run VM
        uses: uraimo/run-on-arch-action@v3
        id: runcmd
        with:
          arch: armv7
          distro: ubuntu20.04
          githubToken: ${{ github.token }}
          run: |
            uname -a
            apt-get update && apt-get install -y wget
            # CMake installed by apt has bug `list sub-command REMOVE_ITEM requires two or more arguments`
            wget --no-check-certificate https://apt.kitware.com/ubuntu/pool/main/c/cmake/{cmake_3.29.2-0kitware1ubuntu20.04.1_armhf.deb,cmake-data_3.29.2-0kitware1ubuntu20.04.1_all.deb}
            dpkg -i *.deb
            apt-get install -y make g++ libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libelf-dev directx-headers-dev rpm
            cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr .
            cmake --build . --target package --verbose -j4
            ./fastfetch --list-features
            time ./fastfetch -c presets/ci.jsonc --stat false
            time ./fastfetch -c presets/ci.jsonc --format json
            time ./flashfetch
            ldd fastfetch
            ctest --output-on-failure

      - name: upload artifacts
        uses: actions/upload-artifact@v4
        with:
          name: fastfetch-linux-armv7l
          path: ./fastfetch-*.*

  linux-armv6l:
    name: Linux-armv6l
    runs-on: ubuntu-24.04
    permissions:
      security-events: write
      contents: read
    steps:
      - name: checkout repository
        uses: actions/checkout@v4

      - name: run VM
        uses: uraimo/run-on-arch-action@v3
        id: runcmd
        with:
          arch: armv6
          distro: bookworm
          githubToken: ${{ github.token }}
          run: |
            uname -a
            apt-get update && apt-get install -y wget
            apt-get install -y cmake make g++ libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libelf-dev directx-headers-dev rpm
            cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr .
            cmake --build . --target package --verbose -j4
            ./fastfetch --list-features
            time ./fastfetch -c presets/ci.jsonc --stat false
            time ./fastfetch -c presets/ci.jsonc --format json
            time ./flashfetch
            ldd fastfetch
            ctest --output-on-failure

      - name: upload artifacts
        uses: actions/upload-artifact@v4
        with:
          name: fastfetch-linux-armv6l
          path: ./fastfetch-*.*

  linux-riscv64:
    name: Linux-riscv64
    runs-on: ubuntu-24.04
    permissions:
      security-events: write
      contents: read
    steps:
      - name: checkout repository
        uses: actions/checkout@v4

      - name: run VM
        uses: uraimo/run-on-arch-action@v3
        id: runcmd
        with:
          arch: riscv64
          distro: ubuntu22.04
          githubToken: ${{ github.token }}
          run: |
            uname -a
            apt-get update && apt-get install -y cmake make g++ libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libddcutil-dev libchafa-dev libelf-dev directx-headers-dev rpm
            cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr .
            cmake --build . --target package --verbose -j4
            ./fastfetch --list-features
            time ./fastfetch -c presets/ci.jsonc --stat false
            time ./fastfetch -c presets/ci.jsonc --format json
            time ./flashfetch
            ldd fastfetch
            ctest --output-on-failure

      - name: upload artifacts
        uses: actions/upload-artifact@v4
        with:
          name: fastfetch-linux-riscv64
          path: ./fastfetch-*.*

  linux-ppc64le:
    name: Linux-ppc64le
    runs-on: ubuntu-24.04
    permissions:
      security-events: write
      contents: read
    steps:
      - name: checkout repository
        uses: actions/checkout@v4

      - name: run VM
        uses: uraimo/run-on-arch-action@v3
        id: runcmd
        with:
          arch: ppc64le
          distro: ubuntu20.04
          githubToken: ${{ github.token }}
          run: |
            uname -a
            apt-get update && apt-get install -y cmake make g++ libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libchafa-dev libelf-dev directx-headers-dev rpm
            cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr .
            cmake --build . --target package --verbose -j4
            ./fastfetch --list-features
            time ./fastfetch -c presets/ci.jsonc --stat false
            time ./fastfetch -c presets/ci.jsonc --format json
            time ./flashfetch
            ldd fastfetch
            ctest --output-on-failure

      - name: upload artifacts
        uses: actions/upload-artifact@v4
        with:
          name: fastfetch-linux-ppc64le
          path: ./fastfetch-*.*

  linux-s390x:
    name: Linux-s390x
    runs-on: ubuntu-24.04
    permissions:
      security-events: write
      contents: read
    steps:
      - name: checkout repository
        uses: actions/checkout@v4

      - name: run VM
        uses: uraimo/run-on-arch-action@v3
        id: runcmd
        with:
          arch: s390x
          distro: ubuntu20.04
          githubToken: ${{ github.token }}
          run: |
            uname -a
            apt-get update && apt-get install -y cmake make g++ libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libchafa-dev libelf-dev directx-headers-dev rpm
            cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr .
            cmake --build . --target package --verbose -j4
            ./fastfetch --list-features
            time ./fastfetch -c presets/ci.jsonc --stat false
            time ./fastfetch -c presets/ci.jsonc --format json
            time ./flashfetch
            ldd fastfetch
            ctest --output-on-failure

      - name: upload artifacts
        uses: actions/upload-artifact@v4
        with:
          name: fastfetch-linux-s390x
          path: ./fastfetch-*.*

  musl-amd64:
    name: Musl-amd64
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: setup alpine linux
        uses: jirutka/setup-alpine@master

      - name: install dependencies
        run: |
          cat /etc/alpine-release
          uname -a
          apk add cmake samurai vulkan-loader-dev libxcb-dev wayland-dev libdrm-dev dconf-dev imagemagick-dev chafa-dev zlib-dev dbus-dev mesa-dev opencl-dev xfconf-dev sqlite-dev networkmanager-dev pulseaudio-dev ddcutil-dev elfutils-dev gcc g++
        shell: alpine.sh --root {0}

      - name: build
        run: |
            cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr -DIS_MUSL=ON -DENABLE_EMBEDDED_PCIIDS=On -DENABLE_EMBEDDED_AMDGPUIDS=On -GNinja .
            cmake --build . --target package --verbose -j4
        shell: alpine.sh {0}

      - name: run
        run: |
            ./fastfetch --list-features
            time ./fastfetch -c presets/ci.jsonc --stat false
            time ./fastfetch -c presets/ci.jsonc --format json
            time ./flashfetch
            ldd fastfetch
            ctest --output-on-failure
        shell: alpine.sh {0}

      - name: upload artifacts
        uses: actions/upload-artifact@v4
        with:
          name: fastfetch-musl-amd64
          path: ./fastfetch-*.*

  macos-universal:
    name: macOS-universal
    runs-on: macos-latest
    permissions:
      security-events: write
      contents: read
    steps:
      - name: checkout repository
        uses: actions/checkout@v4

      - name: uname -a
        run: uname -a

      - name: install required packages
        run: |
          HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install --overwrite vulkan-loader vulkan-headers molten-vk imagemagick chafa

      - name: configure project
        run: cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_OSX_ARCHITECTURES='arm64;x86_64' .

      - name: build project
        run: cmake --build . --target package --verbose -j4

      - name: list features
        run: ./fastfetch --list-features

      - name: run fastfetch
        run: time ./fastfetch -c presets/ci.jsonc --stat false

      - name: run fastfetch --format json
        run: time ./fastfetch -c presets/ci.jsonc --format json

      - name: run flashfetch
        run: time ./flashfetch

      - name: print dependencies
        run: otool -L fastfetch

      - name: run tests
        run: ctest --output-on-failure

      - name: upload artifacts
        uses: actions/upload-artifact@v4
        with:
          name: fastfetch-macos-universal
          path: ./fastfetch-*.*

  sunos-amd64:
    runs-on: ubuntu-latest
    name: SunOS-amd64
    steps:
      - name: checkout repository
        uses: actions/checkout@v4

      - name: run VM
        uses: vmactions/omnios-vm@v1
        with:
          usesh: true
          prepare: |
            uname -a
            pkg update --accept
            pkg install gcc13 cmake git pkg-config glib2 dbus sqlite-3 imagemagick

          run: |
            cmake -DSET_TWEAK=Off -DBUILD_TESTS=On .
            cmake --build . --target package --verbose -j4
            ./fastfetch --list-features
            time ./fastfetch -c presets/ci.jsonc --stat false
            time ./fastfetch -c presets/ci.jsonc --format json
            time ./flashfetch
            ldd fastfetch
            ctest --output-on-failure
            cpack

      - name: upload artifacts
        uses: actions/upload-artifact@v4
        with:
          name: fastfetch-sunos-amd64
          path: ./fastfetch-*.*

  freebsd-amd64:
    name: FreeBSD-amd64
    runs-on: ubuntu-latest
    permissions:
      security-events: write
      contents: read
    steps:
      - name: checkout repository
        uses: actions/checkout@v4

      - name: run VM
        uses: cross-platform-actions/action@master
        with:
          operating_system: freebsd
          architecture: x86-64
          cpu_count: 4
          shell: bash
          version: '14.2'
          run: |
            uname -a
            sudo pkg update
            sudo pkg install -y cmake git pkgconf binutils wayland vulkan-headers vulkan-loader libxcb libXrandr libX11 libdrm glib dconf dbus sqlite3-tcl xfce4-conf egl opencl ocl-icd v4l_compat chafa
            cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=On -DENABLE_EMBEDDED_AMDGPUIDS=On .
            cmake --build . --target package --verbose -j4
            ./fastfetch --list-features
            time ./fastfetch -c presets/ci.jsonc --stat false
            time ./fastfetch -c presets/ci.jsonc --format json
            time ./flashfetch
            ldd fastfetch
            ctest --output-on-failure

      - name: upload artifacts
        uses: actions/upload-artifact@v4
        with:
          name: fastfetch-freebsd-amd64
          path: ./fastfetch-*.*

  openbsd-amd64:
    name: OpenBSD-amd64
    runs-on: ubuntu-latest
    permissions:
      security-events: write
      contents: read
    steps:
      - name: checkout repository
        uses: actions/checkout@v4

      - name: run VM
        uses: cross-platform-actions/action@master
        with:
          operating_system: openbsd
          architecture: x86-64
          cpu_count: 4
          shell: bash
          version: '7.6'
          run: |
            uname -a
            sudo pkg_add -r cmake git pkgconf wayland vulkan-headers vulkan-loader glib2 dconf dbus sqlite3 xfconf imagemagick chafa
            cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=On -DENABLE_EMBEDDED_AMDGPUIDS=On .
            cmake --build . --target package --verbose -j4
            ./fastfetch --list-features
            time ./fastfetch -c presets/ci.jsonc --stat false
            time ./fastfetch -c presets/ci.jsonc --format json
            time ./flashfetch
            ldd fastfetch
            ctest --output-on-failure

      - name: upload artifacts
        uses: actions/upload-artifact@v4
        with:
          name: fastfetch-openbsd-amd64
          path: ./fastfetch-*.*

  netbsd-amd64:
    name: NetBSD-amd64
    runs-on: ubuntu-latest
    permissions:
      security-events: write
      contents: read
    steps:
      - name: checkout repository
        uses: actions/checkout@v4

      - name: run VM
        uses: cross-platform-actions/action@master
        with:
          operating_system: netbsd
          architecture: x86-64
          cpu_count: 4
          shell: bash
          version: '10.1'
          run: |
            uname -a
            sudo pkgin -y install cmake git pkgconf wayland vulkan-headers dconf dbus sqlite3 ImageMagick opencl-headers ocl-icd
            cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=On -DENABLE_EMBEDDED_AMDGPUIDS=On .
            cmake --build . --target package --verbose -j4
            ./fastfetch --list-features
            time ./fastfetch -c presets/ci.jsonc --stat false
            time ./fastfetch -c presets/ci.jsonc --format json
            time ./flashfetch
            ldd fastfetch
            ctest --output-on-failure

      - name: upload artifacts
        uses: actions/upload-artifact@v4
        with:
          name: fastfetch-netbsd-amd64
          path: ./fastfetch-*.*

  windows-amd64:
    name: Windows-amd64
    runs-on: windows-latest
    permissions:
      security-events: write
      contents: read
    defaults:
      run:
        shell: msys2 {0}
    steps:
      - name: checkout repository
        uses: actions/checkout@v4

      - name: setup-msys2
        uses: msys2/setup-msys2@v2
        with:
          msystem: CLANG64
          update: true
          install: git mingw-w64-clang-x86_64-7zip mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-clang mingw-w64-clang-x86_64-vulkan-loader mingw-w64-clang-x86_64-vulkan-headers mingw-w64-clang-x86_64-opencl-icd mingw-w64-clang-x86_64-opencl-headers mingw-w64-clang-x86_64-cppwinrt mingw-w64-clang-x86_64-imagemagick

      - name: print msys version
        run: uname -a

      - name: configure project
        run: env PKG_CONFIG_PATH=/clang64/lib/pkgconfig/:$PKG_CONFIG_PATH cmake -DSET_TWEAK=Off -DBUILD_TESTS=On .

      - name: build project
        run: cmake --build . --verbose -j4

      - name: copy necessary dlls
        run: cp /clang64/bin/{OpenCL,vulkan-1}.dll .

      - name: list features
        run: ./fastfetch --list-features

      - name: run fastfetch
        run: time ./fastfetch -c presets/ci.jsonc --stat false

      - name: run fastfetch --format json
        run: time ./fastfetch -c presets/ci.jsonc --format json

      - name: run flashfetch
        run: time ./flashfetch

      - name: print dependencies
        run: ldd fastfetch

      - name: run tests
        run: ctest --output-on-failure

      - name: create zip archive
        run: 7z a -tzip -mx9 -bd -y fastfetch-windows-amd64.zip LICENSE *.dll fastfetch.exe flashfetch.exe presets

      - name: create 7z archive
        run: 7z a -t7z -mx9 -bd -y fastfetch-windows-amd64.7z LICENSE *.dll fastfetch.exe flashfetch.exe presets

      - name: upload artifacts
        uses: actions/upload-artifact@v4
        with:
          name: fastfetch-windows-amd64
          path: ./fastfetch-windows-amd64.*

  windows-aarch64:
    name: Windows-aarch64
    runs-on: windows-11-arm
    permissions:
      security-events: write
      contents: read
    defaults:
      run:
        shell: msys2 {0}
    steps:
      - name: checkout repository
        uses: actions/checkout@v4

      - name: setup-msys2
        uses: msys2/setup-msys2@v2
        with:
          msystem: CLANGARM64
          update: true
          install: git mingw-w64-clang-aarch64-7zip mingw-w64-clang-aarch64-cmake mingw-w64-clang-aarch64-clang mingw-w64-clang-aarch64-vulkan-loader mingw-w64-clang-aarch64-vulkan-headers mingw-w64-clang-aarch64-opencl-icd mingw-w64-clang-aarch64-opencl-headers mingw-w64-clang-aarch64-cppwinrt mingw-w64-clang-aarch64-imagemagick

      - name: print msys version
        run: uname -a

      - name: configure project
        run: env PKG_CONFIG_PATH=/clangarm64/lib/pkgconfig/:$PKG_CONFIG_PATH cmake -DSET_TWEAK=Off -DBUILD_TESTS=On .

      - name: build project
        run: cmake --build . --verbose -j4

      - name: copy necessary dlls
        run: cp /clangarm64/bin/{OpenCL,vulkan-1}.dll .

      - name: list features
        run: ./fastfetch --list-features

      - name: run fastfetch
        run: time ./fastfetch -c presets/ci.jsonc --stat false

      - name: run fastfetch --format json
        run: time ./fastfetch -c presets/ci.jsonc --format json

      - name: run flashfetch
        run: time ./flashfetch

      - name: print dependencies
        run: ldd fastfetch

      - name: run tests
        run: ctest --output-on-failure

      - name: create zip archive
        run: 7z a -tzip -mx9 -bd -y fastfetch-windows-aarch64.zip LICENSE *.dll fastfetch.exe flashfetch.exe presets

      - name: create 7z archive
        run: 7z a -t7z -mx9 -bd -y fastfetch-windows-aarch64.7z LICENSE *.dll fastfetch.exe flashfetch.exe presets

      - name: upload artifacts
        uses: actions/upload-artifact@v4
        with:
          name: fastfetch-windows-aarch64
          path: ./fastfetch-windows-aarch64.*

  release:
    if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'fastfetch-cli/fastfetch'
    name: Release
    runs-on: ubuntu-latest
    needs:
      - linux-amd64
      - linux-aarch64
      - linux-armv7l
      - linux-armv6l
      - linux-riscv64
      - linux-ppc64le
      - linux-s390x
      - musl-amd64
      - macos-universal
      - freebsd-amd64
      - openbsd-amd64
      - netbsd-amd64
      - sunos-amd64
      - windows-amd64
      - windows-aarch64
    permissions:
      contents: write
    steps:
      - name: get latest release version
        id: get_version_release
        uses: pozetroninc/github-action-get-latest-release@master
        with:
          repository: ${{ github.repository }}

      - name: download artifacts
        if: needs.linux-amd64.outputs.ffversion != steps.get_version_release.outputs.release
        uses: actions/download-artifact@v4

      - name: create release
        if: needs.linux-amd64.outputs.ffversion != steps.get_version_release.outputs.release
        uses: ncipollo/release-action@v1
        with:
          tag: ${{ needs.linux-amd64.outputs.ffversion }}
          commit: ${{ github.sha }}
          artifactErrorsFailBuild: true
          artifacts: fastfetch-*/fastfetch-*
          body: "Please refer to [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/${{ needs.linux-amd64.outputs.ffversion }}/CHANGELOG.md) for details."

      - name: download source tarballs
        if: needs.linux-amd64.outputs.ffversion != steps.get_version_release.outputs.release
        run: |
          for i in 1 2 3 4 5; do curl -L --remote-name-all --output-dir fastfetch-source --create-dirs https://github.com/${{ github.repository }}/archive/refs/tags/${{ needs.linux-amd64.outputs.ffversion }}.{tar.gz,zip} && break || sleep 5; done
          ls fastfetch-*/*

      - name: generate release notes
        if: needs.linux-amd64.outputs.ffversion != steps.get_version_release.outputs.release
        run: |
          echo "Please refer to [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/${{ needs.linux-amd64.outputs.ffversion }}/CHANGELOG.md) for details." > fastfetch-release-notes.md
          echo -e "\n---\n\n<details><summary>SHA256SUMs</summary><br>\n\n\`\`\`" >> fastfetch-release-notes.md
          sha256sum fastfetch-*/* >> fastfetch-release-notes.md
          echo -e "\`\`\`\n</details>" >> fastfetch-release-notes.md
          echo -e "\n<details><summary>SHA512SUMs</summary><br>\n\n\`\`\`" >> fastfetch-release-notes.md
          sha512sum fastfetch-*/* >> fastfetch-release-notes.md
          echo -e "\`\`\`\n</details>" >> fastfetch-release-notes.md

      - name: update release body
        if: needs.linux-amd64.outputs.ffversion != steps.get_version_release.outputs.release
        uses: ncipollo/release-action@v1
        with:
          tag: ${{ needs.linux-amd64.outputs.ffversion }}
          commit: ${{ github.sha }}
          bodyFile: fastfetch-release-notes.md
          allowUpdates: true