2023-04-18 12:41:35 +00:00
|
|
|
---
|
2023-04-22 03:43:00 +00:00
|
|
|
name: WAU - Auto Create Pre-Release Version
|
2023-04-17 23:00:26 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
2023-12-06 07:08:10 +00:00
|
|
|
- cron: "0 0 * * *"
|
2023-04-17 23:00:26 +00:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
check_merged:
|
|
|
|
name: Compare latest merge and tag
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
should_run: ${{ steps.should_run.outputs.SHOULD_RUN }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
2023-09-11 06:54:10 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-04-17 23:00:26 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Check if latest merged is older than latest tag
|
|
|
|
id: should_run
|
|
|
|
run: |
|
|
|
|
echo "Latest tag:"
|
|
|
|
git log --tags --pretty="%ci - %h - %s %d" -n 1
|
|
|
|
LATEST_TAG_DATE=$(git log --tags -n 1 --pretty="%ct")
|
|
|
|
echo $LATEST_TAG_DATE
|
|
|
|
|
|
|
|
echo "Latest merge:"
|
|
|
|
git log --merges --pretty="%ci - %h - %s %d" -n 1
|
|
|
|
LATEST_MERGE_DATE=$(git log --merges -n 1 --pretty="%ct")
|
|
|
|
echo $LATEST_MERGE_DATE
|
|
|
|
|
|
|
|
if [[ $LATEST_MERGE_DATE -gt $LATEST_TAG_DATE ]]; then
|
|
|
|
echo "Latest tag is older than latest merge. Nightly will be created."
|
|
|
|
echo "SHOULD_RUN=true" >> $GITHUB_OUTPUT
|
|
|
|
else
|
|
|
|
echo "Latest merge is not older than latest tag. No new release needed."
|
|
|
|
echo "SHOULD_RUN=false" >> $GITHUB_OUTPUT
|
|
|
|
fi
|
|
|
|
|
|
|
|
build:
|
|
|
|
name: Create Release Asset
|
|
|
|
needs: [check_merged]
|
|
|
|
if: ${{ needs.check_merged.outputs.should_run == 'true' }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
2023-09-11 06:54:10 +00:00
|
|
|
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
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Auto Increment Semver Action
|
2024-01-15 06:24:28 +00:00
|
|
|
uses: MCKanpolat/auto-semver-action@5003b8d37f4b03d95f15303ea10242cbf7c13141 # 2
|
2023-04-17 23:00:26 +00:00
|
|
|
id: versioning
|
|
|
|
with:
|
|
|
|
releaseType: prerelease
|
|
|
|
incrementPerCommit: false
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Next Release Number
|
|
|
|
id: WAU_version
|
|
|
|
run: |
|
|
|
|
echo "Next Release version: ${{ steps.versioning.outputs.version }}"
|
|
|
|
|
|
|
|
- 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:
|
2023-12-12 20:31:40 +00:00
|
|
|
path: Sources/WAU/Winget-AutoUpdate/Version.txt
|
2023-04-17 23:00:26 +00:00
|
|
|
write-mode: overwrite
|
2023-04-22 12:00:07 +00:00
|
|
|
contents: ${{ steps.versioning.outputs.version }}
|
2023-04-17 23:00:26 +00:00
|
|
|
|
|
|
|
- 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-12-12 20:31:40 +00:00
|
|
|
echo "### Get MDT from Microsoft ###"
|
2023-10-19 14:48:04 +00:00
|
|
|
wget https://download.microsoft.com/download/3/3/9/339BE62D-B4B8-4956-B58D-73C4685FC492/MicrosoftDeploymentToolkit_x64.msi
|
2023-12-12 20:31:40 +00:00
|
|
|
|
|
|
|
echo "### Extract MSI ###"
|
2023-10-19 14:48:04 +00:00
|
|
|
7z x MicrosoftDeploymentToolkit_x64.msi
|
2023-12-12 20:31:40 +00:00
|
|
|
|
|
|
|
echo "### Copy ServiceUI.exe to 'Sources/WAU/Winget-AutoUpdate' folder ###"
|
|
|
|
mv Modena_File206 Sources/WAU/Winget-AutoUpdate/ServiceUI.exe -v
|
|
|
|
|
|
|
|
echo "### Go to Sources ###"
|
|
|
|
cd Sources
|
|
|
|
|
|
|
|
echo "### Zip WAU ###"
|
|
|
|
cd WAU
|
|
|
|
zip -r ../../WAU.zip Winget-AutoUpdate
|
|
|
|
zip ../../WAU.zip Winget-AutoUpdate-Install.ps1
|
|
|
|
zip ../../WAU.zip excluded_apps.txt
|
2023-10-10 16:10:45 +00:00
|
|
|
cd ..
|
2023-12-12 20:31:40 +00:00
|
|
|
|
|
|
|
echo "### Zip WAU-Configurator ###"
|
|
|
|
zip -r ../WAU-Configurator.zip WAU
|
|
|
|
zip ../WAU-Configurator.zip "WAU Configurator.lnk"
|
|
|
|
|
|
|
|
echo "### Zip ADMX ###"
|
|
|
|
cd Policies
|
|
|
|
zip -r ../../WAU_ADMX.zip *
|
|
|
|
cd ../..
|
|
|
|
|
|
|
|
echo "### Create install counter file ###"
|
2023-12-05 14:24:35 +00:00
|
|
|
echo "Install counter file." > WAU_InstallCounter
|
2023-04-17 23:00:26 +00:00
|
|
|
|
|
|
|
- name: Create release
|
2023-10-30 10:15:47 +00:00
|
|
|
uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0
|
2023-04-17 23:00:26 +00:00
|
|
|
id: release
|
|
|
|
with:
|
|
|
|
tag: "v${{ steps.versioning.outputs.version }}"
|
|
|
|
prerelease: true
|
|
|
|
generateReleaseNotes: true
|
|
|
|
name: "v${{ steps.versioning.outputs.version }} [Nightly Build]"
|
2023-12-12 23:11:31 +00:00
|
|
|
artifacts: "WAU-Configurator.zip,WAU.zip,WAU_ADMX.zip,WAU_InstallCounter"
|
2023-04-17 23:00:26 +00:00
|
|
|
|
|
|
|
- name: URL to release
|
2023-04-20 02:35:54 +00:00
|
|
|
run: echo "Release -> ${{ steps.release.outputs.html_url }}"
|