wingetautoupdate/.github/workflows/WAU-CreateNewVersion.yml

85 lines
2.7 KiB
YAML
Raw Normal View History

2023-04-18 12:41:35 +00:00
---
2023-04-22 03:43:31 +00:00
name: WAU - Create New Version
2023-04-17 23:00:26 +00:00
on:
workflow_dispatch:
inputs:
version:
type: choice
2023-04-22 11:06:20 +00:00
default: "Patch"
2023-04-17 23:00:26 +00:00
description: Select next release type
options:
2023-04-18 12:41:35 +00:00
- Patch
- Minor
- Major
2023-04-18 12:49:26 +00:00
required: true
2023-04-17 23:00:26 +00:00
pre-release:
type: boolean
description: Set as Pre-release version
permissions:
contents: write
jobs:
build:
name: Create Release Asset
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
2023-04-17 23:00:26 +00:00
with:
2023-04-22 11:06:20 +00:00
lfs: "true"
2023-04-17 23:00:26 +00:00
- name: Auto Increment Semver Action
2023-10-30 10:15:47 +00:00
uses: MCKanpolat/auto-semver-action@b0314e8d64baee1c3f74233edb71eb976503a6a4 # 1.0.10
2023-04-17 23:00:26 +00:00
id: versioning
with:
releaseType: ${{ github.event.inputs.version }}
incrementPerCommit: false
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Overwrite Version.txt file
2023-10-30 10:15:47 +00:00
uses: DamianReeves/write-file-action@0a7fcbe1960c53fc08fe789fa4850d24885f4d84 # v1.2
2023-04-17 23:00:26 +00:00
with:
path: Winget-AutoUpdate/Version.txt
write-mode: overwrite
contents: "${{ steps.versioning.outputs.version }}"
- name: Commit & Push
2023-10-30 10:15:47 +00:00
uses: actions-js/push@156f2b10c3aa000c44dbe75ea7018f32ae999772 # v1.4
2023-04-17 23:00:26 +00:00
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
force: true
2023-04-22 11:06:20 +00:00
message: "Changed version to ${{ steps.versioning.outputs.version }}"
2023-04-17 23:00:26 +00:00
- name: Build project
run: |
2023-10-19 14:48:04 +00:00
# Get MDT from Microsoft
wget https://download.microsoft.com/download/3/3/9/339BE62D-B4B8-4956-B58D-73C4685FC492/MicrosoftDeploymentToolkit_x64.msi
# Extract MSI
7z x MicrosoftDeploymentToolkit_x64.msi
# Copy ServiceUI.exe to Winget-AutoUpdate folder
mv Modena_File206 Winget-AutoUpdate/ServiceUI.exe
# Zip WAU
2023-10-10 16:10:45 +00:00
zip -r WAU.zip Winget-AutoUpdate
zip WAU.zip Winget-AutoUpdate-Install.ps1
zip WAU.zip excluded_apps.txt
zip WAU.zip install.bat
zip WAU.zip uninstall.bat
2023-10-19 14:48:04 +00:00
# Zip ADMX
2023-10-10 16:10:45 +00:00
cd Policies
zip -r ../WAU_ADMX.zip *
cd ..
# Add install counter
echo "Install counter file." > WAU_InstallCounter
2023-04-17 23:00:26 +00:00
- name: Create release
2023-10-30 10:24:19 +00:00
uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0
2023-04-17 23:00:26 +00:00
with:
2023-10-30 10:24:19 +00:00
tag: "v${{ steps.versioning.outputs.version }}"
2023-04-17 23:00:26 +00:00
prerelease: ${{ github.event.inputs.pre-release }}
generateReleaseNotes: true
name: "v${{ steps.versioning.outputs.version }}"
artifacts: "WAU.zip,WAU_ADMX.zip,WAU_InstallCounter"