Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ jobs:
publish:
runs-on: ubuntu-latest

concurrency:
group: publish-${{ github.event_name }}-${{ github.sha }}
Comment thread
greptile-apps[bot] marked this conversation as resolved.
cancel-in-progress: false
Comment thread
greptile-apps[bot] marked this conversation as resolved.

steps:
- uses: actions/checkout@v7

Expand Down Expand Up @@ -77,7 +81,7 @@ jobs:

- name: Publish core to npm
working-directory: ./packages/core
run: pnpm publish --tag ${{ steps.version.outputs.tag }} --access public --provenance --no-git-checks
run: ../../scripts/publish-if-new.sh ${{ steps.version.outputs.tag }}

# Templates use `skybridge: workspace:*` so dev/CI build against the
# local package. pnpm doesn't rewrite that when bundling the templates
Expand All @@ -93,11 +97,11 @@ jobs:

- name: Publish create-skybridge to npm
working-directory: ./packages/create-skybridge
run: pnpm publish --tag ${{ steps.version.outputs.tag }} --access public --provenance --no-git-checks
run: ../../scripts/publish-if-new.sh ${{ steps.version.outputs.tag }}

- name: Publish devtools to npm
working-directory: ./packages/devtools
run: pnpm publish --tag ${{ steps.version.outputs.tag }} --access public --provenance --no-git-checks
run: ../../scripts/publish-if-new.sh ${{ steps.version.outputs.tag }}

- name: Restore templates workspace deps
if: github.event_name == 'release'
Expand Down
13 changes: 13 additions & 0 deletions scripts/publish-if-new.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -euo pipefail

tag=$1
name=$(node -p 'require("./package.json").name')
version=$(node -p 'require("./package.json").version')

if npm view "$name@$version" version >/dev/null 2>&1; then
echo "$name@$version is already published, skipping"
exit 0
fi

pnpm publish --tag "$tag" --access public --provenance --no-git-checks
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Loading