Created
April 10, 2022 01:14
-
-
Save aaronparker/d1cb514b8dd90bc9dd56c82d4ae7c2ab to your computer and use it in GitHub Desktop.
Updates binaries required for packaging the Microsoft 365 Apps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install and cache PowerShell modules | |
id: psmodulecache | |
uses: potatoqualitee/[email protected] | |
with: | |
modules-to-cache: Evergreen | |
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: Restore Deploy-Application.ps1 | |
shell: pwsh | |
run: | | |
Copy-Item -Path "${{ github.workspace }}/PSAppDeployToolkit/Deploy-Application.ps1" -Destination "${{ github.workspace }}/PSAppDeployToolkit/Toolkit/Deploy-Application.ps1" | |
- name: Update setup.exe | |
shell: pwsh | |
run: | | |
New-Item -Path "${{ github.workspace }}/m365" -ItemType "Directory" -ErrorAction "SilentlyContinue" | |
$File = Get-EvergreenApp -Name "Microsoft365Apps" | Select-Object -First 1 | Save-EvergreenApp -Path "${{ github.workspace }}/tmp" | |
Move-Item -LiteralPath $File.FullName -Destination "${{ github.workspace }}/m365/$($File.Name)" -Force | |
- name: Update IntuneWinAppUtil.exe | |
shell: pwsh | |
run: | | |
New-Item -Path "${{ github.workspace }}/intunewin" -ItemType "Directory" -ErrorAction "SilentlyContinue" | |
$params = @{ | |
Uri = "https://raw.githubusercontent.com/microsoft/Microsoft-Win32-Content-Prep-Tool/master/IntuneWinAppUtil.exe" | |
OutFile = "${{ github.workspace }}/intunewin/IntuneWinAppUtil.exe" | |
UseBasicParsing = $True | |
} | |
Invoke-WebRequest @params | |
- name: Import GPG key | |
id: import_gpg | |
uses: crazy-max/ghaction-import-gpg@v4 | |
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 | |
run: | | |
DATEF=`date +%Y.%m.%d` | |
echo "::set-output name=date::$DATEF" | |
- name: Commit changes | |
id: commit | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
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." | |
- name: "Run if no changes have been detected" | |
if: steps.commit.outputs.changes_detected == 'false' | |
run: echo "No changes detected." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment