Skip to content

Commit 1860fcd

Browse files
committed
feat: update package submission workflows and enhance AUR package manager configuration release:patch
1 parent 8784220 commit 1860fcd

4 files changed

Lines changed: 147 additions & 35 deletions

File tree

.claude/settings.local.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,13 @@
193193
"Bash(git remote:*)",
194194
"Bash(git hook:*)",
195195
"Bash(gh repo create:*)",
196-
"Bash(.husky/pre-commit:*)"
196+
"Bash(.husky/pre-commit:*)",
197+
"Bash(gh secret list:*)",
198+
"Bash(gh secret set:*)",
199+
"Bash(gh api:*)",
200+
"Bash(set -a)",
201+
"Bash(source .env)",
202+
"Bash(set +a)"
197203
],
198204
"deny": [
199205
"Bash(npm *)",

.env.example

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ TURNS_SERVER_URL=turns:turn.pairux.com:5349
4343
NEXT_PUBLIC_APP_URL=http://localhost:3000
4444
NODE_ENV=development
4545

46+
# ===========================================
47+
# Email (Resend)
48+
# ===========================================
49+
# RESEND_API_KEY=re_your-resend-api-key
50+
4651
# ===========================================
4752
# Optional: Code Signing (for desktop releases)
4853
# ===========================================
@@ -65,6 +70,27 @@ NODE_ENV=development
6570
# GPG_PASSPHRASE=your-passphrase
6671
# GPG_KEY_ID=your-key-id
6772

73+
# ===========================================
74+
# Package Manager Submissions
75+
# Used by scripts/submit-packages.ts and GitHub Actions
76+
# ===========================================
77+
# Chocolatey (Windows)
78+
# Get from: https://community.chocolatey.org/account
79+
# CHOCOLATEY_API_KEY=your-chocolatey-api-key
80+
81+
# AUR (Arch Linux)
82+
# Base64 encoded SSH private key with AUR access
83+
# AUR_SSH_KEY=base64-encoded-ssh-private-key
84+
85+
# APT/RPM Repositories
86+
# Base64 encoded GPG private key for package signing
87+
# GPG_PRIVATE_KEY=base64-encoded-gpg-key
88+
# GPG_PASSPHRASE=your-gpg-passphrase
89+
90+
# GitHub Token for package submissions
91+
# Needs repo access for creating PRs/commits
92+
# PKG_SUBMIT_TOKEN=ghp_your-github-token
93+
6894
# ===========================================
6995
# Droplet Deployment (TURN Server)
7096
# Used by GitHub Actions to deploy to DigitalOcean droplet

.github/workflows/submit-packages.yml

Lines changed: 100 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ on:
2121
default: 'all'
2222

2323
jobs:
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

scripts/lib/package-managers/aur.ts

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -68,23 +68,8 @@ depends=('gtk3' 'libnotify' 'nss' 'libxss' 'libxtst' 'xdg-utils' 'at-spi2-core'
6868
provides=('pairux')
6969
conflicts=('pairux' 'pairux-git')
7070
options=('!strip')
71-
source=("PairUX-\${pkgver}.AppImage::https://github.com/profullstack/pairux.com/releases/download/v\${pkgver}/PairUX-\${pkgver}-x64.AppImage"
72-
"pairux.desktop")
73-
sha256sums=('${sha256}'
74-
'SKIP')
75-
76-
prepare() {
77-
cat > pairux.desktop << 'EOF'
78-
[Desktop Entry]
79-
Name=PairUX
80-
Comment=Collaborative screen sharing with remote control
81-
Exec=/opt/pairux/pairux.AppImage --no-sandbox %U
82-
Icon=pairux
83-
Type=Application
84-
Categories=Network;RemoteAccess;
85-
StartupWMClass=PairUX
86-
EOF
87-
}
71+
source=("PairUX-\${pkgver}.AppImage::https://github.com/profullstack/pairux.com/releases/download/v\${pkgver}/PairUX-\${pkgver}-x64.AppImage")
72+
sha256sums=('${sha256}')
8873
8974
package() {
9075
cd "\$srcdir"
@@ -101,8 +86,18 @@ exec /opt/pairux/pairux.AppImage "$@"
10186
WRAPPER
10287
chmod 755 "\$pkgdir/usr/bin/pairux"
10388
104-
# Desktop file
105-
install -Dm644 pairux.desktop "\$pkgdir/usr/share/applications/pairux.desktop"
89+
# Create and install desktop file
90+
cat > "\$srcdir/pairux.desktop" << 'DESKTOP'
91+
[Desktop Entry]
92+
Name=PairUX
93+
Comment=Collaborative screen sharing with remote control
94+
Exec=/opt/pairux/pairux.AppImage --no-sandbox %U
95+
Icon=pairux
96+
Type=Application
97+
Categories=Network;RemoteAccess;
98+
StartupWMClass=PairUX
99+
DESKTOP
100+
install -Dm644 "\$srcdir/pairux.desktop" "\$pkgdir/usr/share/applications/pairux.desktop"
106101
107102
# Extract and install icon from AppImage
108103
cd "\$pkgdir/opt/pairux"
@@ -139,7 +134,6 @@ WRAPPER
139134
\tconflicts = pairux-git
140135
\toptions = !strip
141136
\tsource = PairUX-${version}.AppImage::https://github.com/profullstack/pairux.com/releases/download/v${version}/PairUX-${version}-x64.AppImage
142-
\tsource = pairux.desktop
143137
144138
pkgname = ${PACKAGE_NAME}
145139
`;

0 commit comments

Comments
 (0)