Skip to content

Commit d9d9ce2

Browse files
committed
for gh actions added global variables to make script updating easier, thanks Gleb!
1 parent c2b1618 commit d9d9ce2

1 file changed

Lines changed: 23 additions & 12 deletions

File tree

hub/powertoys/command-palette/publish-extension.md

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -506,13 +506,13 @@ mkdir .github/workflows
506506
#
507507
# To use this template for a new extension:
508508
# 1. Copy this file to a new workflow file (e.g., release-myextension-exe.yml)
509-
# 2. Replace all instances of GITHUB_REPO_URL with your GitHub repository URL (e.g., https://github.com/yourusername/YourRepository)
510-
# 3. Replace all instances of DISPLAY_NAME with your display name (e.g., My Extension)
511-
# 4. Replace all instances of EXTENSION_NAME with your extension name (e.g., CmdPalMyExtension)
512-
# 5. Replace all instances of FOLDER_NAME with your project folder name (e.g., CmdPalMyExtension)
513-
# 6. Update the default version in the build script to match your project file
509+
# 2. Update Global constants with your data:
510+
# - GITHUB_REPO_URL with your GitHub repository URL (e.g., https://github.com/yourusername/YourRepository)
511+
# - DISPLAY_NAME with your display name (e.g., My Extension)
512+
# - EXTENSION_NAME with your extension name (e.g., CmdPalMyExtension)
513+
# - FOLDER_NAME with your project folder name (e.g., CmdPalMyExtension)
514514

515-
name: DISPLAY_NAME - Build EXE Installer
515+
name: CmdPal Extension - Build EXE Installer
516516

517517
on:
518518
workflow_dispatch:
@@ -527,6 +527,15 @@ on:
527527
default: 'New release with latest updates and improvements.'
528528
type: string
529529

530+
531+
# Global constants: UPDATE THESE, example; DISPLAY_NAME: ${{ vars.DISPLAY_NAME || 'CmdPal Name' }}
532+
env:
533+
DISPLAY_NAME: ${{ vars.DISPLAY_NAME || 'DISPLAY_NAME' }}
534+
EXTENSION_NAME: ${{ vars.EXTENSION_NAME || 'EXTENSION_NAME' }}
535+
FOLDER_NAME: ${{ vars.FOLDER_NAME || 'FOLDER_NAME' }}
536+
GITHUB_REPO_URL: ${{ vars.GITHUB_REPO_URL || 'GITHUB_REPO_URL' }}
537+
538+
530539
jobs:
531540
build:
532541
runs-on: windows-2022
@@ -631,11 +640,6 @@ This file is a Github Action scrip that does the following:
631640
- Upload Results (clear artifact + release steps)
632641
633642
1. Update the placeholders in `release-extension.yml`:
634-
- DEVELOPER_NAME
635-
- GITHUB_REPO_URL
636-
- EXTENSION_NAME
637-
- FOLDER_NAME
638-
- GENERATE-NEW-GUID-HERE
639643
1. git commit the 3 new files: `build-exe.ps1`, `setup.iss`,`release-extension.yml`
640644
1. Push changes to Github.
641645
1. Trigger the GitHub Action:
@@ -697,7 +701,7 @@ Check out how [PowerToys](https://github.com/microsoft/PowerToys/blob/main/.gith
697701

698702
You can also use the following `.github\workflows\update-winget-randomriddle.yml`:
699703

700-
```
704+
```yml
701705
# Replace EXTENSION_NAME
702706
# Replace GITHUB_USER_NAME
703707
# Replace GITHUB_REPO
@@ -720,6 +724,13 @@ on:
720724
required: false
721725
type: string
722726
727+
# Global constants: UPDATE THESE, example; DISPLAY_NAME: ${{ vars.DISPLAY_NAME || 'CmdPal Name' }}
728+
env:
729+
DISPLAY_NAME: ${{ vars.DISPLAY_NAME || 'DISPLAY_NAME' }}
730+
EXTENSION_NAME: ${{ vars.GITHUB_USER_NAME || 'GITHUB_USER_NAME' }}
731+
FOLDER_NAME: ${{ vars.GITHUB_REPO || 'GITHUB_REPO' }}
732+
GITHUB_REPO_URL: ${{ vars.YOUR_PACKAGE_IDENTITY_NAME_HERE || 'YOUR_PACKAGE_IDENTITY_NAME_HERE' }}
733+
723734
jobs:
724735
update-winget:
725736
# Only run if this is a EXTENSION_NAME release

0 commit comments

Comments
 (0)