99 tags :
1010 - ' v*'
1111
12- # Permissions for GITHUB_TOKEN (principle of least privilege)
1312permissions :
1413 contents : write # Needed for creating releases
1514 issues : read
1615 pull-requests : read
1716
18- # Add restrictions for parallel runs
1917concurrency :
2018 group : ${{ github.workflow }}-${{ github.ref }}
2119 cancel-in-progress : true
@@ -26,22 +24,29 @@ jobs:
2624 strategy :
2725 matrix :
2826 platform : [x64, arm64]
29-
27+
3028 steps :
3129 - name : Checkout code
3230 uses : actions/checkout@v4
33-
31+
3432 - name : Setup .NET
3533 uses : actions/setup-dotnet@v4
3634 with :
3735 dotnet-version : ' 9.0.x'
38-
36+
3937 - name : Build
40- run : dotnet build RandomGen/RandomGen.sln -c Release -p:Platform="${{ matrix.platform }}"
41-
38+ run : |
39+ dotnet build \
40+ RandomGen/Community.PowerToys.Run.Plugin.RandomGen/Community.PowerToys.Run.Plugin.RandomGen.csproj \
41+ -c Release -p:Platform="${{ matrix.platform }}"
42+
4243 - name : Publish
43- run : dotnet publish RandomGen/RandomGen.sln -c Release -p:Platform="${{ matrix.platform }}" -o ./Publish/${{ matrix.platform }}
44-
44+ run : |
45+ dotnet publish \
46+ RandomGen/Community.PowerToys.Run.Plugin.RandomGen/Community.PowerToys.Run.Plugin.RandomGen.csproj \
47+ -c Release -p:Platform="${{ matrix.platform }}" \
48+ -o ./Publish/${{ matrix.platform }}
49+
4550 - name : Get version
4651 id : get_version
4752 shell : bash
@@ -53,170 +58,95 @@ jobs:
5358 echo "VERSION=$(date +'%Y.%m.%d')-$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_OUTPUT
5459 echo "IS_TAG=false" >> $GITHUB_OUTPUT
5560 fi
56-
57- - name : Debug Output
58- run : |
59- Get-ChildItem -Path "RandomGen" -Recurse -Directory | Where-Object { $_.Name -eq "Release" } | ForEach-Object { Write-Host $_.FullName }
60- shell : pwsh
61-
62- - name : Create output directory
61+
62+ - name : Create artifacts directory
6363 run : mkdir -p artifacts
64-
64+
6565 - name : Copy build output to artifacts directory
66+ shell : pwsh
6667 run : |
6768 $artifactDir = "artifacts/RandomGen-v${{ steps.get_version.outputs.VERSION }}-${{ matrix.platform }}"
68-
69- # Create the artifact directory
70- New-Item -ItemType Directory -Force -Path $artifactDir
71-
72- # Create RandomGen subfolder
7369 New-Item -ItemType Directory -Force -Path "$artifactDir/RandomGen"
74-
75- # Define the direct path to the build output
76- $buildOutput = "./Publish/${{ matrix.platform }}"
77-
78- # Fallback to searching for the correct path if the direct path doesn't exist
79- if (-not (Test-Path $buildOutput)) {
80- $buildOutput = "RandomGen/Community.PowerToys.Run.Plugin.RandomGen/bin/Release/net9.0-windows10.0.22621.0/win-${{ matrix.platform }}/publish"
81- }
82-
83- Write-Host "Using build output directory: $buildOutput"
84-
85- # Check if the directory exists
86- if (-not (Test-Path $buildOutput)) {
87- Write-Host "Build output directory not found at expected path. Searching for it..."
88- $buildOutput = Get-ChildItem -Path "RandomGen" -Recurse -Directory |
89- Where-Object { $_.Name -eq "Release" -and $_.FullName -like "*${{ matrix.platform }}*" } |
90- Select-Object -First 1 -ExpandProperty FullName
91-
92- if ($buildOutput) {
93- Write-Host "Found build output directory: $buildOutput"
94- } else {
95- Write-Error "Could not find any Release directory for platform ${{ matrix.platform }}"
96- exit 1
97- }
98- }
99-
100- # Check if build output exists before proceeding
101- if (-not (Test-Path $buildOutput)) {
102- Write-Error "Build output directory not found"
103- exit 1
104- }
105-
106- # Check for files directly in the build output directory
107- $files = Get-ChildItem -Path $buildOutput -File
108- if ($files.Count -gt 0) {
109- Write-Host "Found $($files.Count) files in build output directory. Copying directly..."
110- Copy-Item -Path "$buildOutput/*" -Destination "$artifactDir/RandomGen" -Recurse -Force
111- Write-Host "Files copied successfully"
112- } else {
113- # Look for a .NET runtime folder
114- $runtimeFolder = Get-ChildItem -Path $buildOutput -Directory |
115- Where-Object { $_.Name -like "net*-windows*" } |
116- Select-Object -First 1 -ExpandProperty FullName
117-
118- if ($runtimeFolder) {
119- Write-Host "Found runtime folder: $runtimeFolder"
120- Copy-Item -Path "$runtimeFolder/*" -Destination "$artifactDir/RandomGen" -Recurse -Force
121- Write-Host "Files copied successfully from runtime folder"
122- } else {
123- # If no runtime folder, check for any subdirectories
124- $subDirs = Get-ChildItem -Path $buildOutput -Directory
125- if ($subDirs.Count -gt 0) {
126- $firstSubDir = $subDirs[0].FullName
127- Write-Host "No runtime folder found, but found subdirectory: $firstSubDir"
128- Copy-Item -Path "$firstSubDir/*" -Destination "$artifactDir/RandomGen" -Recurse -Force
129- Write-Host "Files copied from first subdirectory"
130- } else {
131- Write-Error "No files or subdirectories found in build output directory"
132- exit 1
133- }
134- }
135- }
136- shell : pwsh
137-
70+ Copy-Item -Path "./Publish/${{ matrix.platform }}/*" -Destination "$artifactDir/RandomGen" -Recurse -Force
71+
13872 - name : Create ZIP archive
73+ shell : pwsh
13974 run : |
14075 $artifactDir = "artifacts/RandomGen-v${{ steps.get_version.outputs.VERSION }}-${{ matrix.platform }}"
141- $zipFile = "RandomGen-v${{ steps.get_version.outputs.VERSION }}-${{ matrix.platform }}.zip"
142-
143- # Create the zip file
76+ $zipFile = "RandomGen-v${{ steps.get_version.outputs.VERSION }}-${{ matrix.platform }}.zip"
14477 Compress-Archive -Path "$artifactDir/RandomGen" -DestinationPath "artifacts/$zipFile"
145- shell : pwsh
146-
78+
14779 - name : Upload build artifacts
14880 uses : actions/upload-artifact@v4
14981 with :
15082 name : build-artifacts-${{ matrix.platform }}
15183 path : artifacts/*.zip
152-
84+
15385 release :
15486 needs : build
15587 runs-on : ubuntu-latest
15688 if : startsWith(github.ref, 'refs/tags/v')
157-
89+
15890 steps :
15991 - name : Checkout code
16092 uses : actions/checkout@v4
161-
162- - name : Download all artifacts
93+
94+ - name : Download artifacts
16395 uses : actions/download-artifact@v4
16496 with :
16597 path : artifacts
166-
98+
16799 - name : Get version from tag
168100 id : get_version
169101 run : echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
170-
102+
171103 - name : Prepare Release Notes
172104 id : release_notes
173105 run : |
174106 cat > release_notes.md << 'EOL'
175- # 📝 RandomGen v${{ steps.get_version.outputs.VERSION }}
107+ # 🎲 RandomGen v${{ steps.get_version.outputs.VERSION }} - Unleashed!
176108
177109 <p align="center">
178110 <img src="https://github.com/ruslanlap/PowerToysRun-RandomGen/blob/main/assets/randomgen.logo.png" width="128px" alt="RandomGen Logo" />
179111 </p>
180112
181- ## ✨ What's New
113+ ## ✨ What's New in this Epic Release
182114
183115 <!-- Add your release highlights here -->
184- - 🚀 Performance improvements
185- - 🐛 Bug fixes
186- - ✨ New features
116+ - 🚀 Turbocharged performance for lightning-fast randomness
117+ - 🛡️ Squashed those pesky bugs that were hiding in the shadows
118+ - 🔮 Magical new features to supercharge your productivity
187119
188- ## 📥 Installation
120+ ## 🧙♂️ Installation Magic
189121
190- 1. Download the ZIP file for your platform (x64 or ARM64)
191- 2. Extract to `%LOCALAPPDATA%\Microsoft\PowerToys\PowerToys Run\Plugins\RandomGen`
192- 3. Restart PowerToys
193- 4. Start using with `Alt+Space` then type `rd` followed by a command
122+ 1. 📦 Download the mystical ZIP file for your realm (x64 or ARM64)
123+ 2. 🔓 Extract the arcane contents to `%LOCALAPPDATA%\Microsoft\PowerToys\PowerToys Run\Plugins\RandomGen`
124+ 3. 🔄 Summon a PowerToys restart to activate the spell
125+ 4. ✨ Invoke the power with `Alt+Space` then conjure `rd` followed by your command
194126
195- ## 🔍 Quick Commands
127+ ## ⚡ Spellbook of Commands
196128
197- | Command | Description |
198- |------------------------|------------------------------------ |
199- | `rd password [length]` | Generate a secure password |
200- | `rd pin [length]` | Generate a numeric PIN |
201- | `rd guid` | Generate a GUID/UUID |
202- | `rd number min-max` | Generate a random number in range |
203- | `rd name` | Generate a random person name |
204- | `rd email` | Generate a random email address |
205- | `rd date` | Generate a random date |
206- | `rd color` | Generate a random hex color |
129+ | Incantation | What Magic It Performs |
130+ |------------------------|-----------------------------------|
131+ | `rd password [length]` | Forge an unbreakable password |
132+ | `rd pin [length]` | Conjure a mystical numeric PIN |
133+ | `rd guid` | Summon a unique dimensional GUID |
134+ | `rd number min-max` | Roll cosmic dice within your range |
135+ | `rd name` | Generate an identity from the void |
136+ | `rd email` | Materialize a digital address |
137+ | `rd date` | Pluck a random day from the timeline |
138+ | `rd color` | Extract a chromatic hex essence |
207139
208- ## 🙏 Thank You
140+ ## 💫 Join the RandomGen Universe
209141
210- Thank you for using RandomGen! If you encounter any issues or have suggestions, please [open an issue](https://github.com/ruslanlap/PowerToysRun-RandomGen/issues).
142+ Your cosmic journey with RandomGen matters! Encountered a glitch in the matrix or have ideas to bend reality? [Open an issue](https://github.com/ruslanlap/PowerToysRun-RandomGen/issues) and shape the future!
211143
212- Made with ❤️ by <a href="https://github.com/ruslanlap">ruslanlap</a>
144+ Crafted with ✨ cosmic energy ✨ by <a href="https://github.com/ruslanlap">ruslanlap</a>
213145 EOL
214-
215- RELEASE_NOTES=$(cat release_notes.md)
216146 echo "RELEASE_NOTES<<EOF" >> $GITHUB_OUTPUT
217- echo "$RELEASE_NOTES" >> $GITHUB_OUTPUT
147+ cat release_notes.md >> $GITHUB_OUTPUT
218148 echo "EOF" >> $GITHUB_OUTPUT
219-
149+
220150 - name : Create Release
221151 id : create_release
222152 uses : softprops/action-gh-release@v2
@@ -226,16 +156,16 @@ jobs:
226156 draft : false
227157 prerelease : false
228158 files : |
229- artifacts/build-artifacts -x64/* .zip
230- artifacts/build-artifacts -arm64/* .zip
231-
159+ artifacts/RandomGen-v${{ steps.get_version.outputs.VERSION }} -x64.zip
160+ artifacts/RandomGen-v${{ steps.get_version.outputs.VERSION }} -arm64.zip
161+
232162 - name : Create Latest Release Artifacts
233163 if : success()
234164 run : |
235165 mkdir -p latest_release
236- cp artifacts/build-artifacts-x64/ RandomGen-v${{ steps.get_version.outputs.VERSION }}-x64.zip latest_release/RandomGen-latest-x64.zip
237- cp artifacts/build-artifacts-arm64/ RandomGen-v${{ steps.get_version.outputs.VERSION }}-arm64.zip latest_release/RandomGen-latest-arm64.zip
238-
166+ cp artifacts/RandomGen-v${{ steps.get_version.outputs.VERSION }}-x64.zip latest_release/RandomGen-latest-x64.zip
167+ cp artifacts/RandomGen-v${{ steps.get_version.outputs.VERSION }}-arm64.zip latest_release/RandomGen-latest-arm64.zip
168+
239169 - name : Update Latest Release Artifacts
240170 if : success()
241171 uses : softprops/action-gh-release@v2
@@ -244,4 +174,4 @@ jobs:
244174 tag_name : latest
245175 files : |
246176 latest_release/RandomGen-latest-x64.zip
247- latest_release/RandomGen-latest-arm64.zip
177+ latest_release/RandomGen-latest-arm64.zip
0 commit comments