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

ci: simplify workflows #478

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft
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
6 changes: 4 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ blank_issues_enabled: true
contact_links:
- name: 💡 Feature requests
url: https://github.com/biomejs/biome-vscode/discussions/new
about: Please use a new GitHub discussion to propose ideas of feature requests.
about: Please use a new GitHub discussion to propose ideas of feature requests

- name: 🗣️ Chat
url: https://discord.gg/BypW39g6Yc
about: Our Discord server is active and is used for real-time discussions including contribution collaboration, questions, and more!

- name: 🆘 Support
url: https://discord.gg/BypW39g6Yc
about: "For assistance, please use the #help channel on our Discord community."
about: "For assistance, please use the #help channel on our Discord community"
38 changes: 31 additions & 7 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,39 @@ on:

jobs:
quality:
name: Quality
name: 🔍 Quality

runs-on: ubuntu-latest

steps:
- name: Checkout
- name: 📥 Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Setup Biome
with:
# Disable credentials
persist-credentials: false

- name: 🔧 Setup Biome
uses: biomejs/setup-biome@c016c38f26f2c4a6eb3662679143614a254263fd # v2
- name: Run Biome checks

- name: 🏃 Run Biome checks
run: biome ci --reporter=github
package:
name: Package
uses: ./.github/workflows/~package-stable.yaml

build:
name: Build

runs-on: ubuntu-latest

steps:
- name: 📥 Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
# Disable credentials
persist-credentials: false

- name: 🛠️ Setup PNPM
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
with:
run_install: true

- name: 🛠️ Build extension
run: pnpm run build
64 changes: 45 additions & 19 deletions .github/workflows/release-prerelease.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,55 @@
# This workflow is responsible for releasing a new prerelease version of the
# This workflow is responsible for releasing a new prerelease version of the
# extension. It is meant to be triggered manually.

name: 🌙 Release new prerelease version

on:
workflow_dispatch:
on: [workflow_dispatch]

permissions:
contents: write

jobs:
generate-prerelease-version:
name: Generate prerelease version
publish-prerelease:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.generate-prerelease-version.outputs.version }}

steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Generate prerelease version
id: generate-prerelease-version
- name: 📥 Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: 🛠️ Setup PNPM
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
with:
run_install: true

- name: 🛠️ Generate prerelease version
run: |
version=$(date +"%Y.%-m.%-d%H%M")
echo "version=$version" >> $GITHUB_OUTPUT
publish:
name: Release prerelease
needs: [generate-prerelease-version]
uses: ./.github/workflows/~publish-prerelease.yaml
secrets: inherit
with:
version: ${{ needs.generate-prerelease-version.outputs.version }}
echo "version=$version" >> $GITHUB_ENV


- name: 📝 Patch package.json version with prerelease identifier
run: |
jq \
--arg version "${{ inputs.version }}" \
--tab '.version = $version' \
package.json > package.json.tmp \
&& mv package.json.tmp package.json

- name: 🛠️ Build extension
run: pnpm run build

- name: 📦 Package VSIX
run: pnpm run package --pre-release

- name: 🌐 Publish to Open VSX Registry
uses: HaaLeo/publish-vscode-extension@28e2d3f5817fccf23c1f219eb0cecc903132d1a2 # v1.6.2
with:
pat: ${{ secrets.OVSX_PAT }}
extensionFile: biome.vsix

- name: 🌐 Publish to Visual Studio Marketplace
uses: HaaLeo/publish-vscode-extension@28e2d3f5817fccf23c1f219eb0cecc903132d1a2 # v1.6.2
with:
pat: ${{ secrets.VSCE_PAT }}
registryUrl: https://marketplace.visualstudio.com
extensionFile: biome.vsix
102 changes: 66 additions & 36 deletions .github/workflows/release-stable.yaml
Original file line number Diff line number Diff line change
@@ -1,66 +1,96 @@
# This workflow is responsible for releasing a new stable version of the
# This workflow is responsible for releasing a new stable version of the
# extension. It is meant to be triggered manually and will automatically
# determine the next version number based on the commit history, which it will
# use to create a new tag. Publication of the new version will be handled by
# the `publish-stable.yaml` workflows.
# use to create a new tag

name: 🚀 Release new stable version

on:
workflow_dispatch:
on: [workflow_dispatch]

permissions:
contents: write

jobs:
tag:
name: Tag stable
release:
runs-on: ubuntu-latest
permissions: write-all
outputs:
version: ${{ steps.next-version.outputs.version }}

steps:
- name: Checkout
- name: 📥 Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
# Fetch the whole history so we can determine the next version number
# based on the commit history.
fetch-depth: 0
- name: Setup Biome

- name: 🛠️ Setup PNPM
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
with:
run_install: true

- name: 🔧 Setup Biome
uses: biomejs/setup-biome@c016c38f26f2c4a6eb3662679143614a254263fd # v2
- name: Set up git-cliff

- name: 🔧 Set up git-cliff
uses: kenji-miyake/setup-git-cliff@2778609c643a39a2576c4bae2e493b855eb4aee8 # v2
- name: Determine next version
id: next-version

- name: 🔧 Configure Git
run: |
version="$(git-cliff --bumped-version --config .git-cliff/release-notes.toml 2>/dev/null)"
echo "version=${version:1}" >> $GITHUB_OUTPUT
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git config --global push.followTags true

- name: 🔍 Determine next version
run: |
NEW_VERSION="$(git-cliff --bumped-version --config .git-cliff/release-notes.toml 2>/dev/null)"
echo "NEW_VERSION=${NEW_VERSION:1}" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Patch package.json version with stable identifier

- name: 📝 Patch package.json version
run: |
jq \
--arg version "${{ steps.next-version.outputs.version }}" \
--tab '.version = $version' \
package.json > package.json.tmp \
&& mv package.json.tmp package.json
biome format --write package.json
- name: Generate changelog

- name: 🛠️ Build extension
run: pnpm run build

- name: 📦 Package VSIX
run: pnpm run package

- name: 📜 Generate changelog and release notes
run: |
git-cliff \
--config .git-cliff/changelog.toml \
--tag v${{ steps.next-version.outputs.version }} \
> CHANGELOG.md 5014d9d9291a7de6c11afbe154ce73225c45aefb..
- name: Commit, tag, and push
git-cliff --config .git-cliff/changelog.toml --tag v$NEW_VERSION > CHANGELOG.md 5014d9d9291a7de6c11afbe154ce73225c45aefb..
git-cliff --config .git-cliff/release-notes.toml --latest > RELEASE_NOTES.md

- name: 📝 Commit changes and tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add package.json CHANGELOG.md
git commit -m "chore(release): v${{ steps.next-version.outputs.version }}"
git tag -a v${{ steps.next-version.outputs.version }} -m "v${{ steps.next-version.outputs.version }}"
bun run format
git add .
git commit -m "chore(release): v$NEW_VERSION"
git tag -a v$NEW_VERSION -m "v$NEW_VERSION"
git push --follow-tags

publish:
name: Publish
needs: [tag]
uses: ./.github/workflows/~publish-stable.yaml
secrets: inherit
with:
version: ${{ needs.tag.outputs.version }}
- name: 🚀 Publish to GitHub Releases
uses: softprops/action-gh-release@v2
with:
name: v${{ env.NEW_VERSION }}
tag_name: v${{ env.NEW_VERSION }}
body_path: RELEASE_NOTES.md
files: biome.vsix

- name: 🌐 Publish to Open VSX Registry
uses: HaaLeo/publish-vscode-extension@28e2d3f5817fccf23c1f219eb0cecc903132d1a2 # v1.6.2
with:
pat: ${{ secrets.OVSX_PAT }}
extensionFile: biome.vsix

- name: 🌐 Publish to Visual Studio Marketplace
uses: HaaLeo/publish-vscode-extension@28e2d3f5817fccf23c1f219eb0cecc903132d1a2 # v1.6.2
with:
pat: ${{ secrets.VSCE_PAT }}
registryUrl: https://marketplace.visualstudio.com
extensionFile: biome.vsix
38 changes: 0 additions & 38 deletions .github/workflows/~package-prerelease.yaml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/~package-stable.yaml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/~publish-prerelease.yaml

This file was deleted.

Loading