Skip to content

Release Zed Extension #7

Release Zed Extension

Release Zed Extension #7

name: Release Zed Extension
on:
workflow_dispatch:
inputs:
release_type:
description: 'Release type (major, minor, patch)'
required: true
default: 'minor'
type: choice
options:
- major
- minor
- patch
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
actions: read
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
token: ${{ secrets.GH_ACCESS_TOKEN }}
fetch-depth: 0 # Fetch all history for tags
- 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: Bump version without git operations
run: npm version ${{ github.event.inputs.release_type }} --no-git-tag-version
- name: Get new version
id: get_version
run: echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
- name: Update extension.toml version
run: sed -i 's/^version = ".*"/version = "${{ steps.get_version.outputs.VERSION }}"/' extension.toml
- name: Commit and tag the version bump
run: |
git add package.json package-lock.json extension.toml
git commit -m "Release v${{ steps.get_version.outputs.VERSION }}"
git tag "v${{ steps.get_version.outputs.VERSION }}"
- name: Push changes and tags
run: git push origin HEAD --tags
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
name: v${{ steps.get_version.outputs.VERSION }}
tag_name: v${{ steps.get_version.outputs.VERSION }}
generate_release_notes: true
- name: Checkout tag for extension publish
run: |
git fetch --tags
git checkout "v${{ steps.get_version.outputs.VERSION }}"
- uses: huacnlee/zed-extension-action@v1
with:
extension-name: material-icon-theme
push-to: material-extensions/zed-extensions
create-pullrequest: true
commit-message: "Update Material Icon Theme to v${{ steps.get_version.outputs.VERSION }}"
tag-name: v${{ steps.get_version.outputs.VERSION }}
env:
COMMITTER_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}