Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,9 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_CONFIG_PROVENANCE: true
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Update Template Repo
if: steps.changesets.outputs.published
run: pnpm -F @sveltejs/create update-template-repo
env:
UPDATE_TEMPLATE_SSH_KEY: ${{ secrets.UPDATE_TEMPLATE_SSH_KEY }}
3 changes: 1 addition & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
"scripts": {
"check": "tsc",
"format": "pnpm lint --write",
"lint": "prettier --check . --config ../../prettier.config.js --ignore-path ../../.gitignore --ignore-path .gitignore --ignore-path ../../.prettierignore",
"postpublish": "pnpm -F @sveltejs/create update-template-repo"
"lint": "prettier --check . --config ../../prettier.config.js --ignore-path ../../.gitignore --ignore-path .gitignore --ignore-path ../../.prettierignore"
},
"files": [
"dist"
Expand Down
16 changes: 11 additions & 5 deletions packages/create/scripts/update-template-repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ get_abs_filename() {
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
}

get_sv_version() {
pnpm -F sv exec node -p "require('./package.json').version"
}

VERSION=$(get_sv_version)
DIR=$(get_abs_filename $(dirname "$0"))
TMP=$(get_abs_filename "$DIR/../node_modules/.tmp")

Expand All @@ -31,8 +36,9 @@ if [ "$CI" ]; then
git config user.name '[bot]'
fi

# commit the new files
git add -A
git commit -m "version $npm_package_version"

git push git@github.com:sveltejs/kit-template-default.git main -f
# commit when there are new files
if [[ `git status --porcelain` ]]; then
git add -A
git commit -m "version $VERSION"
git push git@github.com:sveltejs/kit-template-default.git main -f
fi