2121 default : ' all'
2222
2323jobs :
24- submit :
24+ # Linux job for most package managers
25+ submit-linux :
2526 runs-on : ubuntu-latest
26- name : Submit to Package Managers
27+ name : Submit (Linux)
2728
2829 steps :
2930 - name : Checkout code
@@ -86,14 +87,23 @@ jobs:
8687 - name : Determine package managers
8788 id : pms
8889 run : |
89- if [ -n "${{ github.event.inputs.package_managers }}" ]; then
90- PMS="${{ github.event.inputs.package_managers }}"
90+ INPUT_PMS="${{ github.event.inputs.package_managers }}"
91+ if [ -z "$INPUT_PMS" ]; then
92+ INPUT_PMS="all"
93+ fi
94+
95+ # If "all" or contains chocolatey, we need to exclude chocolatey from linux job
96+ if [ "$INPUT_PMS" = "all" ]; then
97+ # Run all except chocolatey on Linux
98+ PMS="homebrew,scoop,winget,aur,apt,rpm"
9199 else
92- PMS="all"
100+ # Remove chocolatey from the list for Linux job
101+ PMS=$(echo "$INPUT_PMS" | sed 's/chocolatey,//g' | sed 's/,chocolatey//g' | sed 's/^chocolatey$//g')
93102 fi
94103 echo "package_managers=$PMS" >> $GITHUB_OUTPUT
95104
96105 - name : Submit to package managers
106+ if : steps.pms.outputs.package_managers != ''
97107 run : |
98108 VERSION="${{ steps.version.outputs.version }}"
99109 PMS="${{ steps.pms.outputs.package_managers }}"
@@ -102,13 +112,9 @@ jobs:
102112 ARGS="-v $VERSION"
103113
104114 # Parse package managers
105- if [ "$PMS" = "all" ]; then
106- ARGS="$ARGS -p all"
107- else
108- for PM in $(echo "$PMS" | tr ',' ' '); do
109- ARGS="$ARGS -p $PM"
110- done
111- fi
115+ for PM in $(echo "$PMS" | tr ',' ' '); do
116+ ARGS="$ARGS -p $PM"
117+ done
112118
113119 # Add dry run flag if enabled
114120 if [ "$DRY_RUN" = "true" ]; then
@@ -126,10 +132,90 @@ jobs:
126132 - name : Summary
127133 if : always()
128134 run : |
129- echo "## Package Submission Summary" >> $GITHUB_STEP_SUMMARY
135+ echo "## Package Submission Summary (Linux) " >> $GITHUB_STEP_SUMMARY
130136 echo "" >> $GITHUB_STEP_SUMMARY
131137 echo "- **Version**: ${{ steps.version.outputs.version }}" >> $GITHUB_STEP_SUMMARY
132138 echo "- **Package Managers**: ${{ steps.pms.outputs.package_managers }}" >> $GITHUB_STEP_SUMMARY
133139 echo "- **Dry Run**: ${{ github.event.inputs.dry_run || 'false' }}" >> $GITHUB_STEP_SUMMARY
140+
141+ # Windows job for Chocolatey
142+ submit-chocolatey :
143+ runs-on : windows-latest
144+ name : Submit (Chocolatey)
145+ if : >-
146+ github.event.inputs.package_managers == 'all' ||
147+ github.event.inputs.package_managers == '' ||
148+ contains(github.event.inputs.package_managers, 'chocolatey')
149+
150+ steps :
151+ - name : Checkout code
152+ uses : actions/checkout@v4
153+
154+ - name : Setup pnpm
155+ uses : pnpm/action-setup@v4
156+
157+ - name : Setup Node.js
158+ uses : actions/setup-node@v4
159+ with :
160+ node-version : 24
161+ cache : ' pnpm'
162+
163+ - name : Install dependencies
164+ run : pnpm install --frozen-lockfile
165+
166+ - name : Determine version
167+ id : version
168+ shell : bash
169+ run : |
170+ if [ -n "${{ github.event.inputs.version }}" ]; then
171+ VERSION="${{ github.event.inputs.version }}"
172+ elif [ -n "${{ github.event.release.tag_name }}" ]; then
173+ VERSION="${{ github.event.release.tag_name }}"
174+ else
175+ VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
176+ fi
177+ # Remove v prefix if present
178+ VERSION="${VERSION#v}"
179+ echo "version=$VERSION" >> $GITHUB_OUTPUT
180+ echo "Submitting version: $VERSION"
181+
182+ - name : Check Chocolatey API key
183+ id : check-key
184+ shell : bash
185+ run : |
186+ if [ -z "$CHOCOLATEY_API_KEY" ]; then
187+ echo "has_key=false" >> $GITHUB_OUTPUT
188+ echo "::warning::CHOCOLATEY_API_KEY secret not configured, skipping"
189+ else
190+ echo "has_key=true" >> $GITHUB_OUTPUT
191+ fi
192+ env :
193+ CHOCOLATEY_API_KEY : ${{ secrets.CHOCOLATEY_API_KEY }}
194+
195+ - name : Submit to Chocolatey
196+ if : steps.check-key.outputs.has_key == 'true'
197+ shell : bash
198+ run : |
199+ VERSION="${{ steps.version.outputs.version }}"
200+ DRY_RUN="${{ github.event.inputs.dry_run }}"
201+
202+ ARGS="-v $VERSION -p chocolatey"
203+
204+ if [ "$DRY_RUN" = "true" ]; then
205+ ARGS="$ARGS --dry-run"
206+ fi
207+
208+ echo "Running: npx tsx scripts/submit-packages.ts $ARGS"
209+ npx tsx scripts/submit-packages.ts $ARGS
210+ env :
211+ GITHUB_TOKEN : ${{ secrets.PKG_SUBMIT_TOKEN || secrets.GITHUB_TOKEN }}
212+ CHOCOLATEY_API_KEY : ${{ secrets.CHOCOLATEY_API_KEY }}
213+
214+ - name : Summary
215+ if : always()
216+ shell : bash
217+ run : |
218+ echo "## Package Submission Summary (Chocolatey)" >> $GITHUB_STEP_SUMMARY
134219 echo "" >> $GITHUB_STEP_SUMMARY
135- echo "Check the logs above for detailed submission status." >> $GITHUB_STEP_SUMMARY
220+ echo "- **Version**: ${{ steps.version.outputs.version }}" >> $GITHUB_STEP_SUMMARY
221+ echo "- **Dry Run**: ${{ github.event.inputs.dry_run || 'false' }}" >> $GITHUB_STEP_SUMMARY
0 commit comments