Skip to content

Commit 11185d0

Browse files
committed
build: Fix GH Actions version usage
1 parent 870596d commit 11185d0

File tree

2 files changed

+89
-51
lines changed

2 files changed

+89
-51
lines changed

.github/workflows/glpi-agent-ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717

1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2020
- name: Install packages
2121
run: |
2222
sudo apt -y install cpanminus libmodule-install-perl libxml-libxml-perl \
@@ -57,7 +57,7 @@ jobs:
5757
runs-on: windows-latest
5858

5959
steps:
60-
- uses: actions/checkout@v3
60+
- uses: actions/checkout@v4
6161
- name: Update environment
6262
run: |
6363
echo 'C:\Strawberry\perl\bin' >> $GITHUB_PATH
@@ -73,7 +73,7 @@ jobs:
7373
perl -e "@t = localtime; print 'cache-version='.$^V.'-'.int($t[7]/7)" >>%GITHUB_OUTPUT%
7474
shell: cmd
7575
- name: Restore perl lib cache
76-
uses: actions/cache@v3
76+
uses: actions/cache@v4
7777
id: cache
7878
with:
7979
path: |
@@ -109,7 +109,7 @@ jobs:
109109
runs-on: macos-latest
110110

111111
steps:
112-
- uses: actions/checkout@v3
112+
- uses: actions/checkout@v4
113113
- name: Update environment
114114
run: |
115115
PERL_PREFIX=$(perl -MConfig -e 'print $Config{prefix}')
@@ -129,7 +129,7 @@ jobs:
129129
echo "$(brew --prefix)/opt/libxml2/bin" >> $GITHUB_PATH
130130
- name: Restore perl lib cache
131131
id: cache
132-
uses: actions/cache@v3
132+
uses: actions/cache@v4
133133
with:
134134
path: |
135135
/usr/local/Cellar/perl/*/lib/perl5/site_perl

.github/workflows/glpi-agent-packaging.yml

Lines changed: 84 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
macosx-notarization: ${{ steps.set-version.outputs.macosx-notarization }}
4545

4646
steps:
47-
- uses: actions/checkout@v3
47+
- uses: actions/checkout@v4
4848
- name: Set version
4949
id: set-version
5050
run: |
@@ -186,14 +186,14 @@ jobs:
186186
needs: setup-release
187187

188188
steps:
189-
- uses: actions/checkout@v3
189+
- uses: actions/checkout@v4
190190
- name: Create folders for cached datas
191191
run: |
192192
mkdir C:\Strawberry-perl-for-GLPI-Agent_build\restore
193193
mkdir C:\Strawberry-perl-for-GLPI-Agent_build\tools
194194
shell: cmd
195195
- name: Restore points cache
196-
uses: actions/cache@v3
196+
uses: actions/cache@v4
197197
with:
198198
path: |
199199
C:/Strawberry-perl-for-GLPI-Agent_build/tools
@@ -203,7 +203,6 @@ jobs:
203203
if: success() || failure()
204204
run: |
205205
dir C:\Strawberry-perl-for-GLPI-Agent_build\restore
206-
dir C:\Strawberry-perl-for-GLPI-Agent_build\tools
207206
shell: cmd
208207
- name: Update environment
209208
run: |
@@ -227,11 +226,11 @@ jobs:
227226
run: |
228227
cpanm --notest --verbose Perl::Dist::Strawberry
229228
shell: cmd
230-
- name: Fix Perl::Dist::Strawberry for perl 5.34
229+
- name: Fix Perl::Dist::Strawberry for perl
231230
run: |
232231
perl -i -pe "s/makefile.mk/Makefile/" C:\Strawberry\perl\site\lib\Perl\Dist\Strawberry\Step\InstallPerlCore.pm
233232
shell: cmd
234-
- name: Fix Perl::Dist::Strawberry to support patching perl 5.34
233+
- name: Fix Perl::Dist::Strawberry to support patching perl
235234
run: |
236235
perl -i -pe "s/use Text::Diff;/use Text::Diff;use Text::Patch;/" C:\Strawberry\perl\site\lib\Perl\Dist\Strawberry\Step.pm
237236
shell: cmd
@@ -274,15 +273,15 @@ jobs:
274273
shell: cmd
275274
- name: Upload windows built artifacts
276275
if: success() || failure()
277-
uses: actions/upload-artifact@v3
276+
uses: actions/upload-artifact@v4
278277
with:
279-
name: Windows-Build
278+
name: Windows-Build-${{ matrix.arch }}
280279
path: C:\Strawberry-perl-for-GLPI-Agent_build\output
281280
- name: Upload debug MSI-Build artifacts
282281
if: failure() #success() || failure() # Only enable on failure or when debugging is required
283-
uses: actions/upload-artifact@v3
282+
uses: actions/upload-artifact@v4
284283
with:
285-
name: MSI-Build-Debug
284+
name: MSI-Build-Debug-${{ matrix.arch }}
286285
path: C:\Strawberry-perl-for-GLPI-Agent_build\build\msi
287286
- name: VirusTotal Scan
288287
uses: crazy-max/ghaction-virustotal@v3
@@ -301,9 +300,9 @@ jobs:
301300
VT_API_KEY: ${{ secrets.VT_API_KEY }}
302301
- name: Upload VirusTotal Report
303302
if: ${{ vars.VT_SKIP_REPORT_ANALYSIS != 'yes' && ( needs.setup-release.outputs.create-release == 'yes' || startsWith(needs.setup-release.outputs.tag_name, 'nightly') ) }}
304-
uses: actions/upload-artifact@v3
303+
uses: actions/upload-artifact@v4
305304
with:
306-
name: VirusTotal-Report
305+
name: VirusTotal-Report-${{ matrix.arch }}
307306
path: C:\Strawberry-perl-for-GLPI-Agent_build\output\*.json
308307
- name: Upload Portable Archive Asset
309308
id: upload-portable-archive-asset
@@ -343,9 +342,9 @@ jobs:
343342
needs: setup-release
344343

345344
steps:
346-
- uses: actions/checkout@v3
345+
- uses: actions/checkout@v4
347346
- name: Restore points cache
348-
uses: actions/cache@v3
347+
uses: actions/cache@v4
349348
with:
350349
path: |
351350
contrib/macosx/*.gz
@@ -409,15 +408,15 @@ jobs:
409408
shell: bash
410409
- name: Upload MacOSX built artifacts
411410
if: success() || failure()
412-
uses: actions/upload-artifact@v3
411+
uses: actions/upload-artifact@v4
413412
with:
414-
name: MacOSX-Build
413+
name: MacOSX-Build-${{ matrix.arch }}
415414
path: |
416415
contrib/macosx/build/*.pkg
417416
contrib/macosx/build/*.dmg
418417
- name: Upload MacOSX Perl building debug artifacts
419418
if: success() || failure()
420-
uses: actions/upload-artifact@v3
419+
uses: actions/upload-artifact@v4
421420
with:
422421
name: MacOSX-Perl-Config-${{ matrix.arch }}
423422
path: |
@@ -459,13 +458,13 @@ jobs:
459458
needs: setup-release
460459

461460
steps:
462-
- uses: actions/checkout@v3
461+
- uses: actions/checkout@v4
463462
- uses: snapcore/action-build@v1
464463
id: snapcraft
465464
env:
466465
TERM: ${{ env.TERM }}:${{ needs.setup-release.outputs.version }}
467466
- name: Upload Snap built artifacts
468-
uses: actions/upload-artifact@v3
467+
uses: actions/upload-artifact@v4
469468
with:
470469
name: Snap-Build
471470
path: ${{ steps.snapcraft.outputs.snap }}
@@ -489,7 +488,7 @@ jobs:
489488
needs: setup-release
490489

491490
steps:
492-
- uses: actions/checkout@v3
491+
- uses: actions/checkout@v4
493492
- name: Install build dependencies packages
494493
run: |
495494
sudo apt update
@@ -526,7 +525,7 @@ jobs:
526525
lintian --profile debian --show-overrides -L ">=pedantic"
527526
shell: bash
528527
- name: Upload built deb artifacts
529-
uses: actions/upload-artifact@v3
528+
uses: actions/upload-artifact@v4
530529
with:
531530
name: Debian-Build
532531
path: |
@@ -550,7 +549,7 @@ jobs:
550549
needs: setup-release
551550

552551
steps:
553-
- uses: actions/checkout@v3
552+
- uses: actions/checkout@v4
554553
- name: Install build dependencies packages
555554
run: |
556555
sudo apt update
@@ -576,13 +575,13 @@ jobs:
576575
glpi-agent-task-esx glpi-agent-cron
577576
shell: bash
578577
- name: Upload built rpm artifacts
579-
uses: actions/upload-artifact@v3
578+
uses: actions/upload-artifact@v4
580579
with:
581580
name: RPM-Build
582581
path: |
583582
${{ steps.rpmbuild.outputs.rpmdir }}/noarch/*.rpm
584583
- name: Upload rpm sources artifacts
585-
uses: actions/upload-artifact@v3
584+
uses: actions/upload-artifact@v4
586585
with:
587586
name: RPM-Sources
588587
path: |
@@ -606,14 +605,14 @@ jobs:
606605
needs: [ setup-release, linux-snap-packaging, linux-debian-packaging, linux-rpm-packaging ]
607606

608607
steps:
609-
- uses: actions/checkout@v3
610-
- uses: actions/download-artifact@v3
608+
- uses: actions/checkout@v4
609+
- uses: actions/download-artifact@v4
611610
with:
612611
name: RPM-Build
613-
- uses: actions/download-artifact@v3
612+
- uses: actions/download-artifact@v4
614613
with:
615614
name: Debian-Build
616-
- uses: actions/download-artifact@v3
615+
- uses: actions/download-artifact@v4
617616
with:
618617
name: Snap-Build
619618
- name: Build installer
@@ -633,7 +632,7 @@ jobs:
633632
env:
634633
VERSION: ${{ needs.setup-release.outputs.version }}
635634
- name: Upload built installer artifacts
636-
uses: actions/upload-artifact@v3
635+
uses: actions/upload-artifact@v4
637636
with:
638637
name: Linux-Installer-Build
639638
path: |
@@ -655,14 +654,14 @@ jobs:
655654
needs: [ setup-release, linux-debian-packaging ]
656655

657656
steps:
658-
- uses: actions/checkout@v3
657+
- uses: actions/checkout@v4
659658
# We use AppImage Builder development version as 1.1 is failing
660659
- name: Install AppImage Builder development version
661660
id: install-appimage-builder
662661
run: |
663662
pip3 install git+https://github.com/AppImageCrafters/appimage-builder.git
664663
shell: bash
665-
- uses: actions/download-artifact@v3
664+
- uses: actions/download-artifact@v4
666665
with:
667666
name: Debian-Build
668667
- name: Make AppImage
@@ -691,7 +690,7 @@ jobs:
691690
env:
692691
VERSION: ${{ needs.setup-release.outputs.version }}
693692
- name: Upload built installer artifacts
694-
uses: actions/upload-artifact@v3
693+
uses: actions/upload-artifact@v4
695694
with:
696695
name: Linux-AppImage-Build
697696
path: |
@@ -719,7 +718,7 @@ jobs:
719718
needs: setup-release
720719

721720
steps:
722-
- uses: actions/checkout@v3
721+
- uses: actions/checkout@v4
723722
- name: Install build dependencies packages
724723
run: |
725724
sudo apt update
@@ -741,7 +740,7 @@ jobs:
741740
env:
742741
VERSION: ${{ needs.setup-release.outputs.version }}
743742
- name: Upload built archive artifacts
744-
uses: actions/upload-artifact@v3
743+
uses: actions/upload-artifact@v4
745744
with:
746745
name: Sources
747746
path: |
@@ -763,7 +762,44 @@ jobs:
763762
needs: [ setup-release, windows-packaging, macosx-packaging, linux-snap-packaging, linux-debian-packaging, linux-rpm-packaging, linux-installer, sources ]
764763

765764
steps:
766-
- uses: actions/checkout@v3
765+
- uses: actions/checkout@v4
766+
- uses: actions/download-artifact@v4
767+
with:
768+
name: Linux-Installer-Build
769+
- uses: actions/download-artifact@v4
770+
with:
771+
name: RPM-Build
772+
- uses: actions/download-artifact@v4
773+
with:
774+
name: Debian-Build
775+
- uses: actions/download-artifact@v4
776+
with:
777+
name: Snap-Build
778+
- uses: actions/download-artifact@v4
779+
with:
780+
name: Linux-AppImage-Build
781+
- uses: actions/download-artifact@v4
782+
with:
783+
pattern: MacOSX-Build-*
784+
merge-multiple: true
785+
- uses: actions/download-artifact@v4
786+
with:
787+
pattern: Windows-Build-*
788+
merge-multiple: true
789+
- uses: actions/download-artifact@v4
790+
with:
791+
name: Sources
792+
- name: Generate and upload sha256 file
793+
id: upload-sha256-asset
794+
run: |
795+
# Clean up not published files from Debian-Build
796+
rm -f *.buildinfo *.changes
797+
sha256sum *$VERSION* > glpi-agent-$VERSION.sha256
798+
gh release upload ${{ needs.setup-release.outputs.tag_name }} glpi-agent-$VERSION.sha256
799+
shell: bash
800+
env:
801+
VERSION: ${{ needs.setup-release.outputs.version }}
802+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
767803
- name: Publish release
768804
id: publish-release
769805
run: |
@@ -817,40 +853,42 @@ jobs:
817853
needs: [ setup-release, windows-packaging, macosx-packaging, linux-snap-packaging, linux-debian-packaging, linux-rpm-packaging, linux-installer, sources ]
818854

819855
steps:
820-
- uses: actions/checkout@v3
856+
- uses: actions/checkout@v4
821857
with:
822858
repository: ${{ github.repository_owner }}/glpi-project.github.io
823859
token: ${{ secrets.PUBLISHING_TOKEN }}
824860
fetch-depth: 0
825-
- uses: actions/download-artifact@v3
861+
- uses: actions/download-artifact@v4
826862
with:
827863
name: Linux-Installer-Build
828864
path: glpi-agent
829-
- uses: actions/download-artifact@v3
865+
- uses: actions/download-artifact@v4
830866
with:
831867
name: RPM-Build
832868
path: glpi-agent
833-
- uses: actions/download-artifact@v3
869+
- uses: actions/download-artifact@v4
834870
with:
835871
name: Debian-Build
836872
path: glpi-agent
837-
- uses: actions/download-artifact@v3
873+
- uses: actions/download-artifact@v4
838874
with:
839875
name: Snap-Build
840876
path: glpi-agent
841-
- uses: actions/download-artifact@v3
877+
- uses: actions/download-artifact@v4
842878
with:
843879
name: Linux-AppImage-Build
844880
path: glpi-agent
845-
- uses: actions/download-artifact@v3
881+
- uses: actions/download-artifact@v4
846882
with:
847-
name: MacOSX-Build
883+
pattern: MacOSX-Build-*
848884
path: glpi-agent
849-
- uses: actions/download-artifact@v3
885+
merge-multiple: true
886+
- uses: actions/download-artifact@v4
850887
with:
851-
name: Windows-Build
888+
pattern: Windows-Build-*
852889
path: glpi-agent
853-
- uses: actions/download-artifact@v3
890+
merge-multiple: true
891+
- uses: actions/download-artifact@v4
854892
with:
855893
name: Sources
856894
path: glpi-agent

0 commit comments

Comments
 (0)