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 4 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
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@v4
with:
run_install: true

- name: 🛠️ Build extension
run: pnpm run build
29 changes: 0 additions & 29 deletions .github/workflows/release-prerelease.yaml

This file was deleted.

55 changes: 55 additions & 0 deletions .github/workflows/release-prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# 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]

permissions:
contents: write

jobs:
publish-prerelease:
runs-on: ubuntu-latest

steps:
- name: 📥 Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

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

- name: 🛠️ Generate prerelease version
run: |
version=$(date +"%Y.%-m.%-d%H%M")
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
66 changes: 0 additions & 66 deletions .github/workflows/release-stable.yaml

This file was deleted.

96 changes: 96 additions & 0 deletions .github/workflows/release-stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# 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

name: 🚀 Release new stable version

on: [workflow_dispatch]

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest

steps:
- 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 PNPM
uses: pnpm/action-setup@v4
with:
run_install: true

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

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

- name: 🔧 Configure Git
run: |
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
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: 🛠️ 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$NEW_VERSION > CHANGELOG.md 5014d9d9291a7de6c11afbe154ce73225c45aefb..
git-cliff --config .git-cliff/release-notes.toml --latest > RELEASE_NOTES.md

- name: 📝 Commit changes and tag
run: |
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

- 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.

Loading