Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: publish nightlies as pre-releases #145

Merged
merged 13 commits into from
Feb 18, 2024
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
40 changes: 8 additions & 32 deletions .github/workflows/_package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,47 +33,23 @@ jobs:

- name: Setup
uses: ./.github/actions/setup

- name: Replace name in package.json (nightly)
if: ${{ github.event.inputs.nightly == 'true' }}
run: |
tempfile=$(mktemp)
jq '.name = "biome-nightly"' package.json > $tempfile
mv $tempfile package.json

- name: Replace displayName in package.json (nightly)
if: ${{ github.event.inputs.nightly == 'true' }}
run: |
tempfile=$(mktemp)
jq '.displayName = "Biome (nightly)"' package.json > $tempfile
mv $tempfile package.json

- name: Mark nightly build as preview in package.json
if: ${{ github.event.inputs.nightly == 'true' }}
run: |
tempfile=$(mktemp)
jq '.preview = true' package.json > $tempfile
mv $tempfile package.json

- name: Generate nightly version identifier (nightly)
if: ${{ github.event.inputs.nightly == 'true' }}
id: nightly-version
run: echo "version=$(date +'%Y.%-m.%-d%-H%-M')" >> "$GITHUB_OUTPUT"

- name: Replace version in package.json (nightly)
- name: Patch package.json version
if: ${{ github.event.inputs.nightly == 'true' }}
run: |
tempfile=$(mktemp)
jq --arg version "${{ steps.nightly-version.outputs.version }}" '.version = $version' package.json > $tempfile
mv $tempfile package.json
run: bun scripts/patch-package-version.ts

- name: Read version from package.json
id: version
run: echo "version=$(jq -r '.version' package.json)" >> "$GITHUB_OUTPUT"

- name: Package the extension
- name: Package stable extension
if: ${{ github.event.inputs.nightly == 'false' }}
run: bun vsce package -o biome.vsix

- name: Package pre-release extension
if: ${{ github.event.inputs.nightly == 'true' }}
run: bun vsce package --pre-release -o biome.vsix

- name: Upload the artifact
uses: actions/upload-artifact@v4
with:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:

publish-vs-marketplace:
name: Publish to Visual Studio Marketplace
if: github.ref == 'refs/heads/main'
needs: [package]
runs-on: ubuntu-latest
environment: vscode
Expand All @@ -48,6 +49,7 @@ jobs:

publish-ovsx-registry:
name: Publish to Open VSX Registry
if: github.ref == 'refs/heads/main'
needs: [package]
runs-on: ubuntu-latest
environment: vscode
Expand All @@ -70,6 +72,7 @@ jobs:

publish-github-release:
name: Publish to GitHub Releases
if: github.ref == 'refs/heads/main' && github.event.inputs.nightly == 'false'
needs: [package]
runs-on: ubuntu-latest
permissions:
Expand Down Expand Up @@ -103,8 +106,7 @@ jobs:
- name: Publish extension to GitHub Releases
uses: softprops/action-gh-release@v1
with:
name: "${{ format('v{0}', needs.package.outputs.version) }}${{ needs.package.outputs.nightly == 'true' && ' (nightly)' || '' }}"
name: "${{ format('v{0}', needs.package.outputs.version) }}"
body_path: RELEASE_NOTES.md
prerelease: ${{ needs.package.outputs.nightly == 'true' }}
files: biome.vsix
tag_name: ${{ format('v{0}', needs.package.outputs.version) }}
306 changes: 162 additions & 144 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,146 +1,164 @@
{
"name": "biome",
"publisher": "biomejs",
"displayName": "Biome",
"description": "Biome LSP VS Code Extension",
"version": "2.1.2",
"icon": "resources/icons/icon.png",
"activationEvents": [
"onLanguage:javascript",
"onLanguage:javascriptreact",
"onLanguage:typescript",
"onLanguage:typescriptreact",
"onLanguage:json",
"onLanguage:jsonc"
],
"main": "./out/main.js",
"homepage": "https://github.com/biomejs/biome-vscode",
"readme": "https://github.com/biomejs/biome-vscode#readme",
"repository": {
"type": "git",
"url": "https://github.com/biomejs/biome-vscode.git"
},
"bugs": {
"url": "https://github.com/biomejs/biome-vscode/issues"
},
"engines": {
"vscode": "^1.80.0"
},
"capabilities": {
"untrustedWorkspaces": {
"supported": "limited",
"restrictedConfigurations": ["biome.lspBin"],
"description": "The use of external binaries is disallowed in untrusted workspaces."
}
},
"contributes": {
"languages": [
{
"id": "biome_syntax_tree",
"extensions": [".rast"]
}
],
"grammars": [
{
"language": "biome_syntax_tree",
"scopeName": "source.biome_syntax_tree",
"path": "resources/grammaers/biome_syntax_tree.tmGrammar.json"
}
],
"commands": [
{
"command": "biome.syntaxTree",
"title": "Show Syntax Tree",
"category": "Biome"
},
{
"command": "biome.restartLspServer",
"title": "Restart LSP Server",
"category": "Biome"
},
{
"command": "biome.clearVersionsCache",
"title": "Clear versions cache",
"category": "Biome"
}
],
"menus": {
"commandPalette": [
{
"command": "biome.syntaxTree",
"when": "inBiomeProject"
}
]
},
"configuration": {
"title": "Biome",
"properties": {
"biome_lsp.trace.server": {
"type": "string",
"scope": "window",
"enum": ["off", "messages", "verbose"],
"enumDescriptions": ["No traces", "Error only", "Full log"],
"default": "off",
"description": "Traces the communication between VS Code and the language server."
},
"biome.lspBin": {
"type": "string",
"default": "",
"ignoreSync": true,
"markdownDescription": "The biome lsp server executable. If the path is relative, the workspace folder will be used as base path"
},
"biome.searchInPath": {
"type": "boolean",
"default": true,
"markdownDescription": "Whether to search for the biome executable in the folders declared in the PATH environment variable"
},
"biome.rename": {
"type": "boolean",
"default": false,
"markdownDescription": "Enable/Disable Biome handling renames in the workspace. (Experimental)"
}
}
}
},
"categories": ["Formatters", "Linters"],
"keywords": ["Formatter", "Linter"],
"license": "MIT OR Apache-2.0",
"scripts": {
"compile": "esbuild src/main.ts --bundle --outfile=out/main.js --external:vscode --format=cjs --platform=node --target=node14",
"watch": "bun run compile --sourcemap --watch",
"package": "vsce package --skip-license -o biome_lsp.vsix",
"build": "bun run compile --minify && bun run package",
"install-extension": "code --install-extension biome_lsp.vsix --force",
"format": "biome format . --write",
"check": "biome check .",
"check:apply": "biome check . --apply-unsafe",
"pack:dev": "bun run compile && bun run package && bun run install-extension",
"tsc": "tsc",
"prepare": "lefthook install",
"changelog": "git-cliff --unreleased --prepend CHANGELOG.md"
},
"devDependencies": {
"@biomejs/biome": "^1.5.3",
"@types/node": "^18.19.15",
"@types/resolve": "^1.20.6",
"@types/semver": "^7.5.7",
"@types/vscode": "^1.80.0",
"@vscode/vsce": "^2.23.0",
"esbuild": "^0.20.0",
"git-cliff": "^1.4.0",
"lefthook": "^1.6.1",
"ovsx": "^0.8.3",
"typescript": "^5.3.3"
},
"dependencies": {
"resolve": "^1.22.8",
"semver": "^7.6.0",
"undici": "^6.6.2",
"vscode-languageclient": "^9.0.1"
},
"vsce": {
"dependencies": false,
"skipLicense": true
},
"packageManager": "[email protected]"
"name": "biome",
"publisher": "biomejs",
"displayName": "Biome",
"description": "Biome LSP VS Code Extension",
"version": "2.1.2",
"icon": "resources/icons/icon.png",
"activationEvents": [
"onLanguage:javascript",
"onLanguage:javascriptreact",
"onLanguage:typescript",
"onLanguage:typescriptreact",
"onLanguage:json",
"onLanguage:jsonc"
],
"main": "./out/main.js",
"homepage": "https://github.com/biomejs/biome-vscode",
"readme": "https://github.com/biomejs/biome-vscode#readme",
"repository": {
"type": "git",
"url": "https://github.com/biomejs/biome-vscode.git"
},
"bugs": {
"url": "https://github.com/biomejs/biome-vscode/issues"
},
"engines": {
"vscode": "^1.80.0"
},
"capabilities": {
"untrustedWorkspaces": {
"supported": "limited",
"restrictedConfigurations": [
"biome.lspBin"
],
"description": "The use of external binaries is disallowed in untrusted workspaces."
}
},
"contributes": {
"languages": [
{
"id": "biome_syntax_tree",
"extensions": [
".rast"
]
}
],
"grammars": [
{
"language": "biome_syntax_tree",
"scopeName": "source.biome_syntax_tree",
"path": "resources/grammaers/biome_syntax_tree.tmGrammar.json"
}
],
"commands": [
{
"command": "biome.syntaxTree",
"title": "Show Syntax Tree",
"category": "Biome"
},
{
"command": "biome.restartLspServer",
"title": "Restart LSP Server",
"category": "Biome"
},
{
"command": "biome.clearVersionsCache",
"title": "Clear versions cache",
"category": "Biome"
}
],
"menus": {
"commandPalette": [
{
"command": "biome.syntaxTree",
"when": "inBiomeProject"
}
]
},
"configuration": {
"title": "Biome",
"properties": {
"biome_lsp.trace.server": {
"type": "string",
"scope": "window",
"enum": [
"off",
"messages",
"verbose"
],
"enumDescriptions": [
"No traces",
"Error only",
"Full log"
],
"default": "off",
"description": "Traces the communication between VS Code and the language server."
},
"biome.lspBin": {
"type": "string",
"default": "",
"ignoreSync": true,
"markdownDescription": "The biome lsp server executable. If the path is relative, the workspace folder will be used as base path"
},
"biome.searchInPath": {
"type": "boolean",
"default": true,
"markdownDescription": "Whether to search for the biome executable in the folders declared in the PATH environment variable"
},
"biome.rename": {
"type": "boolean",
"default": false,
"markdownDescription": "Enable/Disable Biome handling renames in the workspace. (Experimental)"
}
}
}
},
"categories": [
"Formatters",
"Linters"
],
"keywords": [
"Formatter",
"Linter"
],
"license": "MIT OR Apache-2.0",
"scripts": {
"compile": "esbuild src/main.ts --bundle --outfile=out/main.js --external:vscode --format=cjs --platform=node --target=node14",
"watch": "bun run compile --sourcemap --watch",
"package": "vsce package --skip-license -o biome_lsp.vsix",
"build": "bun run compile --minify && bun run package",
"install-extension": "code --install-extension biome_lsp.vsix --force",
"format": "biome format . --write",
"check": "biome check .",
"check:apply": "biome check . --apply-unsafe",
"pack:dev": "bun run compile && bun run package && bun run install-extension",
"tsc": "tsc",
"prepare": "lefthook install",
"changelog": "git-cliff --unreleased --prepend CHANGELOG.md"
},
"devDependencies": {
"@biomejs/biome": "^1.5.3",
"@types/node": "^18.19.15",
"@types/resolve": "^1.20.6",
"@types/semver": "^7.5.7",
"@types/vscode": "^1.80.0",
"@vscode/vsce": "^2.23.0",
"esbuild": "^0.20.0",
"git-cliff": "^1.4.0",
"lefthook": "^1.6.1",
"ovsx": "^0.8.3",
"typescript": "^5.3.3"
},
"dependencies": {
"resolve": "^1.22.8",
"semver": "^7.6.0",
"undici": "^6.6.2",
"vscode-languageclient": "^9.0.1"
},
"vsce": {
"dependencies": false,
"skipLicense": true
},
"packageManager": "[email protected]"
}
Loading
Loading