Skip to content

Commit 7bf69dc

Browse files
committed
Publish platform-specific VSIX packages with bundled git-crypt
Packages darwin-arm64, darwin-x64, linux-x64, linux-arm64 with bundled binary, plus a universal fallback without it. Verifies binary presence in each package before publishing.
1 parent ee0be29 commit 7bf69dc

1 file changed

Lines changed: 33 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
path: bin/git-crypt
9494

9595
publish:
96-
needs: test
96+
needs: [test, build-git-crypt]
9797
if: startsWith(github.ref, 'refs/tags/v')
9898
runs-on: ubuntu-latest
9999
permissions:
@@ -119,13 +119,43 @@ jobs:
119119
echo "Error: tag $GITHUB_REF_NAME does not match package.json version $PKG_VERSION"
120120
exit 1
121121
fi
122-
- run: npm run package
122+
123+
- uses: actions/download-artifact@v4
124+
with:
125+
pattern: git-crypt-*
126+
path: artifacts/
127+
128+
- name: Package platform-specific VSIX files
129+
run: |
130+
for target in darwin-arm64 darwin-x64 linux-x64 linux-arm64; do
131+
mkdir -p bin
132+
cp "artifacts/git-crypt-${target}/git-crypt" bin/git-crypt
133+
chmod +x bin/git-crypt
134+
npx vsce package --target "$target"
135+
rm -rf bin
136+
done
137+
138+
- name: Package universal VSIX (no bundled binary)
139+
run: npx vsce package
140+
141+
- name: Verify VSIX contents
142+
run: |
143+
for f in git-crypt-vscode-*-*.vsix; do
144+
echo "=== $f ==="
145+
npx vsce ls --packagePath "$f" | grep -c 'bin/git-crypt' | xargs -I{} test {} -eq 1
146+
done
147+
echo "=== universal ==="
148+
UNIVERSAL=$(ls git-crypt-vscode-*.vsix | grep -v -- '-darwin\|-linux')
149+
npx vsce ls --packagePath "$UNIVERSAL" | grep -c 'bin/git-crypt' | xargs -I{} test {} -eq 0
150+
123151
- name: Create or update GitHub release
124152
run: |
125153
gh release create "$GITHUB_REF_NAME" git-crypt-vscode-*.vsix --title "$GITHUB_REF_NAME" --generate-notes ||
126154
gh release upload "$GITHUB_REF_NAME" git-crypt-vscode-*.vsix --clobber
127155
env:
128156
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
129-
- run: npm run publish
157+
158+
- name: Publish to marketplace
159+
run: npx vsce publish --packagePath git-crypt-vscode-*.vsix
130160
env:
131161
VSCE_PAT: ${{ secrets.VSCE_PAT }}

0 commit comments

Comments
 (0)