Compare commits

...

18 Commits

Author SHA1 Message Date
Chris Titus
508f909fc9 Update pre-release.yaml 2024-07-17 01:04:39 -05:00
Chris Titus
60a6c387e2 Update pre-release.yaml 2024-07-17 01:01:44 -05:00
Chris Titus
1307abc1d6 Update pre-release.yaml 2024-07-17 00:55:44 -05:00
Chris Titus
45a103f76b Update pre-release.yaml 2024-07-17 00:53:21 -05:00
Chris Titus
b84c0d9248 Update pre-release.yaml 2024-07-17 00:52:12 -05:00
Chris Titus
f51c30023a Merge branch 'main' of https://github.com/ChrisTitusTech/winutil 2024-07-17 00:44:04 -05:00
Chris Titus
bce4868896 Update pre-release.yaml 2024-07-17 00:43:58 -05:00
dependabot[bot]
8141baa879
Bump actions/cache from 2 to 4 (#2390)
Bumps [actions/cache](https://github.com/actions/cache) from 2 to 4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v2...v4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-17 00:38:57 -05:00
dependabot[bot]
280f8a7dbc
Bump actions/checkout from 2 to 4 (#2389)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-17 00:38:33 -05:00
Chris Titus
0a472c06c4 Cleanup version creation 2024-07-17 00:36:59 -05:00
Chris Titus
1c72007a29 Update pre-release.yaml 2024-07-17 00:29:37 -05:00
Chris Titus
07434f706b Update pre-release.yaml 2024-07-17 00:13:56 -05:00
Chris Titus
4176435ebf Update dependabot.yml 2024-07-17 00:06:43 -05:00
Chris Titus
a38cfb14d3 pin action/stale and tag debug 2024-07-17 00:03:31 -05:00
Chris Titus
b319c32ae6 Merge branch 'main' of https://github.com/ChrisTitusTech/winutil 2024-07-16 23:55:56 -05:00
Chris Titus
829e46b3a8 fix github actions 2024-07-16 23:55:54 -05:00
ChrisTitusTech
2304b06f68 Compile Winutil 2024-07-17 04:49:41 +00:00
Chris Titus
c90363181c Winget Reversion
A reversion was needed on winget install because a for loop was installing the latest winget submitted app as it ran over.
2024-07-16 23:48:27 -05:00
8 changed files with 65 additions and 58 deletions

9
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
ignore:
- dependency-name: "actions/stale"
versions: '>= 9'

View File

@ -11,7 +11,7 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Get all releases and update update.mb file
run: |

View File

@ -10,11 +10,11 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: actions/cache@v2
- uses: actions/cache@v4
with:
key: ${{ github.ref }}
path: .cache

View File

@ -1,8 +1,12 @@
name: Pre-Release WinUtil
permissions:
contents: write
actions: read
on:
workflow_run:
workflows: ["Compile"] #Ensure Compile winget.ps1 is done
workflows: ["Compile"]
types:
- completed
workflow_dispatch: # Manual trigger added
@ -10,8 +14,6 @@ on:
jobs:
build-runspace:
runs-on: windows-latest
outputs:
version: ${{ steps.extract_version.outputs.version }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
@ -19,17 +21,19 @@ jobs:
- name: Extract Version from winutil.ps1
id: extract_version
run: |
$version = ''
Get-Content ./winutil.ps1 -TotalCount 30 | ForEach-Object {
if ($_ -match 'Version\s*:\s*(\d{2}\.\d{2}\.\d{2})') {
$version = "pre"+$matches[1]
echo "version=$version" >> $GITHUB_OUTPUT
break
}
}
if (-not $version) {
Write-Error "Version not found in winutil.ps1"
exit 1
$version = (Get-Date -Format "yy.MM.dd")
echo "version=$version" >> $env:GITHUB_ENV
shell: pwsh
- name: Create Tag
id: create_tag
run: |
$tagExists = git tag -l $env:VERSION
if ($tagExists -eq "") {
git tag $env:VERSION
git push origin $env:VERSION
} else {
Write-Host "Tag $env:VERSION already exists, skipping tag creation"
}
shell: pwsh
@ -37,12 +41,12 @@ jobs:
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.extract_version.outputs.version }}
name: Pre-Release ${{ steps.extract_version.outputs.version }}
body: "![GitHub Downloads (specific asset, specific tag)](https://img.shields.io/github/downloads/ChrisTitusTech/winutil/${{ steps.extract_version.outputs.version }}/winutil.ps1)"
tag_name: ${{ env.VERSION }}
name: Pre-Release ${{ env.VERSION }}
body: "![GitHub Downloads (specific asset, specific tag)](https://img.shields.io/github/downloads/ChrisTitusTech/winutil/${{ env.VERSION }}/winutil.ps1)"
append_body: false
files: ./winutil.ps1
prerelease: true
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Generate Sponsors 💖
uses: JamesIves/github-sponsors-readme-action@v1

View File

@ -8,7 +8,7 @@ jobs:
name: PS Script Analyzer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: lint
uses: devblackops/github-action-psscriptanalyzer@master
with:
@ -22,7 +22,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Pester
run: |

View File

@ -22,18 +22,17 @@ Function Install-WinUtilProgramWinget {
[Parameter(Position=1)]
[String]$manage = "Installing"
)
$x = 0
$count = $ProgramsToInstall.Count
Write-Progress -Activity "$manage Applications" -Status "Starting" -PercentComplete 0
Write-Host "==========================================="
Write-Host "-- Configuring winget packages ---"
Write-Host "==========================================="
for ($i = 0; $i -le $ProgramsToInstall.Count; $i++) {
$Program = $ProgramsToInstall[$i]
Foreach ($Program in $ProgramsToInstall){
$failedPackages = @()
Write-Progress -Activity "$manage Applications" -Status "$manage $($Program.winget) $($i + 1) of $count" -PercentComplete $(($i/$count) * 100)
if($manage -eq "Installing") {
Write-Progress -Activity "$manage Applications" -Status "$manage $($Program.winget) $($x + 1) of $count" -PercentComplete $($x/$count*100)
if($manage -eq "Installing"){
# Install package via ID, if it fails try again with different scope and then with an unelevated prompt.
# Since Install-WinGetPackage might not be directly available, we use winget install command as a workaround.
# Winget, not all installers honor any of the following: System-wide, User Installs, or Unelevated Prompt OR Silent Install Mode.
@ -41,21 +40,21 @@ Function Install-WinUtilProgramWinget {
Write-Host "Starting install of $($Program.winget) with winget."
try {
$status = $(Start-Process -FilePath "winget" -ArgumentList "install --id $($Program.winget) --silent --accept-source-agreements --accept-package-agreements" -Wait -PassThru -NoNewWindow).ExitCode
if($status -eq 0) {
if($status -eq 0){
Write-Host "$($Program.winget) installed successfully."
continue
}
if ($status -eq -1978335189) {
if ($status -eq -1978335189){
Write-Host "$($Program.winget) No applicable update found"
continue
}
Write-Host "Attempt with User scope"
$status = $(Start-Process -FilePath "winget" -ArgumentList "install --id $($Program.winget) --scope user --silent --accept-source-agreements --accept-package-agreements" -Wait -PassThru -NoNewWindow).ExitCode
if($status -eq 0) {
if($status -eq 0){
Write-Host "$($Program.winget) installed successfully with User scope."
continue
}
if ($status -eq -1978335189) {
if ($status -eq -1978335189){
Write-Host "$($Program.winget) No applicable update found"
continue
}
@ -69,11 +68,11 @@ Function Install-WinUtilProgramWinget {
} else {
Write-Host "Skipping installation with specific user credentials."
}
if($status -eq 0) {
if($status -eq 0){
Write-Host "$($Program.winget) installed successfully with User prompt."
continue
}
if ($status -eq -1978335189) {
if ($status -eq -1978335189){
Write-Host "$($Program.winget) No applicable update found"
continue
}
@ -82,11 +81,11 @@ Function Install-WinUtilProgramWinget {
$failedPackages += $Program
}
}
elseif($manage -eq "Uninstalling") {
if($manage -eq "Uninstalling"){
# Uninstall package via ID using winget directly.
try {
$status = $(Start-Process -FilePath "winget" -ArgumentList "uninstall --id $($Program.winget) --silent" -Wait -PassThru -NoNewWindow).ExitCode
if($status -ne 0) {
if($status -ne 0){
Write-Host "Failed to uninstall $($Program.winget)."
} else {
Write-Host "$($Program.winget) uninstalled successfully."
@ -97,9 +96,7 @@ Function Install-WinUtilProgramWinget {
$failedPackages += $Program
}
}
else {
throw "[Install-WinUtilProgramWinget] Invalid Value for Parameter 'manage', Provided Value is: $manage"
}
$X++
}
Write-Progress -Activity "$manage Applications" -Status "Finished" -Completed
return $failedPackages;

View File

@ -8,7 +8,7 @@
Author : Chris Titus @christitustech
Runspace Author: @DeveloperDurp
GitHub : https://github.com/ChrisTitusTech
Version : 24.07.16
Version : 24.07.17
#>
param (
[switch]$Debug,
@ -45,7 +45,7 @@ Add-Type -AssemblyName System.Windows.Forms
# Variable to sync between runspaces
$sync = [Hashtable]::Synchronized(@{})
$sync.PSScriptRoot = $PSScriptRoot
$sync.version = "24.07.16"
$sync.version = "24.07.17"
$sync.configs = @{}
$sync.ProcessRunning = $false
@ -1001,18 +1001,17 @@ Function Install-WinUtilProgramWinget {
[Parameter(Position=1)]
[String]$manage = "Installing"
)
$x = 0
$count = $ProgramsToInstall.Count
Write-Progress -Activity "$manage Applications" -Status "Starting" -PercentComplete 0
Write-Host "==========================================="
Write-Host "-- Configuring winget packages ---"
Write-Host "==========================================="
for ($i = 0; $i -le $ProgramsToInstall.Count; $i++) {
$Program = $ProgramsToInstall[$i]
Foreach ($Program in $ProgramsToInstall){
$failedPackages = @()
Write-Progress -Activity "$manage Applications" -Status "$manage $($Program.winget) $($i + 1) of $count" -PercentComplete $(($i/$count) * 100)
if($manage -eq "Installing") {
Write-Progress -Activity "$manage Applications" -Status "$manage $($Program.winget) $($x + 1) of $count" -PercentComplete $($x/$count*100)
if($manage -eq "Installing"){
# Install package via ID, if it fails try again with different scope and then with an unelevated prompt.
# Since Install-WinGetPackage might not be directly available, we use winget install command as a workaround.
# Winget, not all installers honor any of the following: System-wide, User Installs, or Unelevated Prompt OR Silent Install Mode.
@ -1020,21 +1019,21 @@ Function Install-WinUtilProgramWinget {
Write-Host "Starting install of $($Program.winget) with winget."
try {
$status = $(Start-Process -FilePath "winget" -ArgumentList "install --id $($Program.winget) --silent --accept-source-agreements --accept-package-agreements" -Wait -PassThru -NoNewWindow).ExitCode
if($status -eq 0) {
if($status -eq 0){
Write-Host "$($Program.winget) installed successfully."
continue
}
if ($status -eq -1978335189) {
if ($status -eq -1978335189){
Write-Host "$($Program.winget) No applicable update found"
continue
}
Write-Host "Attempt with User scope"
$status = $(Start-Process -FilePath "winget" -ArgumentList "install --id $($Program.winget) --scope user --silent --accept-source-agreements --accept-package-agreements" -Wait -PassThru -NoNewWindow).ExitCode
if($status -eq 0) {
if($status -eq 0){
Write-Host "$($Program.winget) installed successfully with User scope."
continue
}
if ($status -eq -1978335189) {
if ($status -eq -1978335189){
Write-Host "$($Program.winget) No applicable update found"
continue
}
@ -1048,11 +1047,11 @@ Function Install-WinUtilProgramWinget {
} else {
Write-Host "Skipping installation with specific user credentials."
}
if($status -eq 0) {
if($status -eq 0){
Write-Host "$($Program.winget) installed successfully with User prompt."
continue
}
if ($status -eq -1978335189) {
if ($status -eq -1978335189){
Write-Host "$($Program.winget) No applicable update found"
continue
}
@ -1061,11 +1060,11 @@ Function Install-WinUtilProgramWinget {
$failedPackages += $Program
}
}
elseif($manage -eq "Uninstalling") {
if($manage -eq "Uninstalling"){
# Uninstall package via ID using winget directly.
try {
$status = $(Start-Process -FilePath "winget" -ArgumentList "uninstall --id $($Program.winget) --silent" -Wait -PassThru -NoNewWindow).ExitCode
if($status -ne 0) {
if($status -ne 0){
Write-Host "Failed to uninstall $($Program.winget)."
} else {
Write-Host "$($Program.winget) uninstalled successfully."
@ -1076,9 +1075,7 @@ Function Install-WinUtilProgramWinget {
$failedPackages += $Program
}
}
else {
throw "[Install-WinUtilProgramWinget] Invalid Value for Parameter 'manage', Provided Value is: $manage"
}
$X++
}
Write-Progress -Activity "$manage Applications" -Status "Finished" -Completed
return $failedPackages;