-
Notifications
You must be signed in to change notification settings - Fork 18
79 lines (68 loc) · 2.59 KB
/
update-binaries.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
# Updates binaries required for packaging the Microsoft 365 Apps
# setup.exe from the Office Deployment Tool
# PSAppDeployToolkit to manage the install
# Microsoft Win32 Content Prep Tool (IntuneWinAppUtil.exe) to package into intunewin format
name: Update binaries
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
on:
workflow_dispatch:
push:
branches:
- main
paths:
- .github/workflows/update-binaries.yml
schedule:
- cron: '0 22 * * 3'
jobs:
update:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install and cache PowerShell modules
id: psmodulecache
uses: potatoqualitee/[email protected]
with:
modules-to-cache: "Evergreen::"
updatable: true
shell: pwsh
- name: New tmp dir
shell: pwsh
run: |
New-Item -Path "${{ github.workspace }}\tmp" -ItemType "Directory" -ErrorAction "SilentlyContinue"
- name: Update PSAppDeployToolkit
shell: pwsh
run: |
New-Item -Path "${{ github.workspace }}\PSAppDeployToolkit" -ItemType "Directory" -ErrorAction "SilentlyContinue"
$File = Get-EvergreenApp -Name "PSAppDeployToolkit" | Save-EvergreenApp -Path "${{ github.workspace }}\tmp"
Expand-Archive -LiteralPath $File.FullName -DestinationPath "${{ github.workspace }}\PSAppDeployToolkit" -Force
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPGKEY }}
passphrase: ${{ secrets.GPGPASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
git_config_global: true
git_tag_gpgsign: true
git_push_gpgsign: false
git_committer_name: ${{ secrets.COMMIT_NAME }}
git_committer_email: ${{ secrets.COMMIT_EMAIL }}
# Format the date number for the commit message
- name: Get date
id: get-date
shell: pwsh
run: |
$Date = Get-Date -Format yyyyMMdd
echo "date=$Date" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
- name: Commit changes
id: commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Update binaries ${{ steps.get-date.outputs.date }}.${{ github.run_number }}"
commit_user_name: ${{ secrets.COMMIT_NAME }}
commit_user_email: ${{ secrets.COMMIT_EMAIL }}
- name: "Run if changes have been detected"
if: steps.commit.outputs.changes_detected == 'true'
run: echo "Changes committed."