mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-05-04 05:15:09 -04:00
remove package publishing workflow
This commit is contained in:
102
.github/workflows/publish-packages.yml
vendored
102
.github/workflows/publish-packages.yml
vendored
@@ -1,102 +0,0 @@
|
||||
name: Publish Packages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'packages/assets/**'
|
||||
- 'packages/ui/**'
|
||||
- '.github/workflows/publish-packages.yml'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9.12.2
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'pnpm'
|
||||
registry-url: 'https://npm.pkg.github.com'
|
||||
scope: '@jamiepine'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --no-frozen-lockfile
|
||||
|
||||
- name: Check and publish @jamiepine/assets
|
||||
if: github.event_name == 'push'
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
if git diff --name-only HEAD~1 HEAD | grep -q '^packages/assets/'; then
|
||||
echo "Changes detected in @jamiepine/assets"
|
||||
cd packages/assets
|
||||
|
||||
# Bump patch version
|
||||
CURRENT_VERSION=$(node -p "require('./package.json').version")
|
||||
NEW_VERSION=$(echo $CURRENT_VERSION | awk -F. '{$NF = $NF + 1;} 1' | sed 's/ /./g')
|
||||
echo "Bumping version from $CURRENT_VERSION to $NEW_VERSION"
|
||||
|
||||
# Update version in package.json
|
||||
npm version $NEW_VERSION --no-git-tag-version
|
||||
|
||||
# Publish
|
||||
npm publish
|
||||
|
||||
# Commit version bump
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git add package.json
|
||||
git commit -m "bump @jamiepine/assets to $NEW_VERSION"
|
||||
git push
|
||||
else
|
||||
echo "No changes detected in @jamiepine/assets, skipping publish"
|
||||
fi
|
||||
|
||||
- name: Check and publish @jamiepine/ui
|
||||
if: github.event_name == 'push'
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
if git diff --name-only HEAD~1 HEAD | grep -q '^packages/ui/'; then
|
||||
echo "Changes detected in @jamiepine/ui"
|
||||
cd packages/ui
|
||||
|
||||
# Bump patch version and replace workspace dependency using jq to preserve all fields
|
||||
CURRENT_VERSION=$(jq -r '.version' package.json)
|
||||
NEW_VERSION=$(echo $CURRENT_VERSION | awk -F. '{$NF = $NF + 1;} 1' | sed 's/ /./g')
|
||||
ASSETS_VERSION=$(jq -r '.version' ../assets/package.json)
|
||||
echo "Bumping version from $CURRENT_VERSION to $NEW_VERSION"
|
||||
echo "Replacing workspace:* with ^$ASSETS_VERSION"
|
||||
|
||||
jq --arg ver "$NEW_VERSION" --arg assets "^$ASSETS_VERSION" \
|
||||
'.version = $ver | .dependencies["@jamiepine/assets"] = $assets' \
|
||||
package.json > package.json.tmp && mv package.json.tmp package.json
|
||||
|
||||
# Build
|
||||
pnpm build
|
||||
|
||||
# Publish
|
||||
npm publish
|
||||
|
||||
# Commit version bump
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git add package.json
|
||||
git commit -m "bump @jamiepine/ui to $NEW_VERSION"
|
||||
git push
|
||||
else
|
||||
echo "No changes detected in @jamiepine/ui, skipping publish"
|
||||
fi
|
||||
Reference in New Issue
Block a user