Skip to content

Commit 469f526

Browse files
authored
chore: setup changesets + oidc (#2844)
- setup changesets: all packages are now released through changesets, only the extension is released via tag as before - remove pkg deploy flows in favor of one - that flow will use oidc, so no npm token anymore - also harden the workflows
1 parent 99e29f2 commit 469f526

File tree

11 files changed

+601
-167
lines changed

11 files changed

+601
-167
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3+
"changelog": [
4+
"@svitejs/changesets-changelog-github-compact",
5+
{ "repo": "sveltejs/language-tools" }
6+
],
7+
"commit": false,
8+
"fixed": [],
9+
"linked": [],
10+
"access": "public",
11+
"baseBranch": "master",
12+
"updateInternalDependencies": "minor",
13+
"bumpVersionsWithWorkspaceProtocolOnly": true,
14+
"ignore": []
15+
}

.github/workflows/CI.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
name: CI
22
on: pull_request
3+
permissions:
4+
contents: read # to fetch code (actions/checkout)
35

46
jobs:
57
test:
8+
permissions: {}
69
runs-on: ubuntu-latest
710

811
steps:
@@ -24,6 +27,7 @@ jobs:
2427
CI: true
2528

2629
test-svelte5:
30+
permissions: {}
2731
runs-on: ubuntu-latest
2832

2933
steps:
@@ -49,6 +53,7 @@ jobs:
4953
CI: true
5054

5155
lint:
56+
permissions: {}
5257
runs-on: ubuntu-latest
5358

5459
steps:

.github/workflows/DeployExtensionsProd.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,22 @@ on:
55
tags:
66
- "extensions-*"
77

8+
permissions: {}
9+
810
jobs:
911
deploy:
12+
# prevents this action from running on forks
13+
if: github.repository == 'sveltejs/language-tools'
14+
permissions:
15+
contents: write # to create release (adjust package.json etc)
1016
runs-on: ubuntu-latest
1117

1218
steps:
1319
- uses: actions/checkout@v4
1420
- uses: pnpm/action-setup@v4
1521
- uses: actions/setup-node@v4
1622
with:
17-
node-version: "20.x"
23+
node-version: "22.x"
1824
registry-url: "https://registry.npmjs.org"
1925
cache: pnpm
2026

.github/workflows/DeploySvelte2tsxProd.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/DeploySvelteCheckProd.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

.github/workflows/DeploySvelteLanguageServerProd.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/DeployTypescriptPluginProd.yaml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions: {}
9+
10+
jobs:
11+
release:
12+
# prevents this action from running on forks
13+
if: github.repository == 'sveltejs/language-tools'
14+
permissions:
15+
contents: write # to create release (changesets/action)
16+
id-token: write # OpenID Connect token needed for provenance
17+
pull-requests: write # to create pull request (changesets/action)
18+
name: Release
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout Repo
22+
uses: actions/checkout@v4
23+
with:
24+
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
25+
fetch-depth: 0
26+
- uses: pnpm/action-setup@v4.1.0
27+
- name: Setup Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: 24.x
31+
cache: pnpm
32+
33+
- run: pnpm install --frozen-lockfile
34+
35+
- name: Create Release Pull Request or Publish to npm
36+
id: changesets
37+
uses: changesets/action@v1
38+
with:
39+
# This expects you to have a script called release which does a build for your packages and calls changeset publish
40+
publish: pnpm changeset:release
41+
version: pnpm changeset:version
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
NPM_CONFIG_PROVENANCE: true

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@
1010
"test": "cross-env CI=true pnpm test -r",
1111
"watch": "tsc -b -watch",
1212
"format": "prettier --write .",
13-
"lint": "prettier --check ."
13+
"lint": "prettier --check .",
14+
"changeset:version": "changeset version && git add --all",
15+
"changeset:publish": "changeset publish"
1416
},
1517
"dependencies": {
1618
"typescript": "^5.9.2"
1719
},
1820
"devDependencies": {
21+
"@changesets/cli": "^2.29.7",
1922
"cross-env": "^7.0.2",
2023
"prettier": "~3.3.3",
2124
"ts-node": "^10.0.0"

0 commit comments

Comments
 (0)