diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..e7c070d --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,18 @@ +name: Release Please + +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: googleapis/release-please-action@v4 + with: + release-type: node diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dc86907..7026dbf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,16 +1,15 @@ -name: Release +name: Publish on: - push: - tags: - - v*.*.* + release: + types: [published] workflow_dispatch: permissions: contents: write jobs: - release: + publish: runs-on: ubuntu-latest steps: @@ -20,8 +19,8 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v6 with: - node-version: lts/* - cache: npm + node-version: 'lts/*' + cache: 'npm' - name: Install dependencies run: npm ci @@ -44,39 +43,16 @@ jobs: name: vsix-package path: '*.vsix' - - name: Get version from tag - id: get_version - if: startsWith(github.ref, 'refs/tags/') - run: | - VERSION=${GITHUB_REF#refs/tags/v} - echo "VERSION=$VERSION" >> $GITHUB_OUTPUT - echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT - - - name: Extract changelog for version - id: changelog - if: startsWith(github.ref, 'refs/tags/') - run: | - VERSION=${GITHUB_REF#refs/tags/v} - # Extract changelog section for this version - sed -n "/## \[$VERSION\]/,/## \[/p" CHANGELOG.md | sed '$d' > release_notes.md - if [ ! -s release_notes.md ]; then - echo "No changelog found for version $VERSION" - echo "# Release $VERSION" > release_notes.md - echo "See CHANGELOG.md for details." >> release_notes.md - fi - - - name: Create GitHub Release + - name: Upload vsix to Release uses: ncipollo/release-action@v1 - if: startsWith(github.ref, 'refs/tags/') + if: github.event_name == 'release' with: + allowUpdates: true + omitBody: true + omitName: true artifacts: '*.vsix' - bodyFile: release_notes.md - draft: false - prerelease: false - name: 'Release ${{ steps.get_version.outputs.TAG }}' - tag: ${{ steps.get_version.outputs.TAG }} token: ${{ secrets.GITHUB_TOKEN }} - name: Publish to VS Code Marketplace - if: startsWith(github.ref, 'refs/tags/') + if: github.event_name == 'release' run: npx @vscode/vsce publish --packagePath *.vsix -p ${{ secrets.VSCE_PAT }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e81010..d300d83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,6 @@ # Changelog -All notable changes to the "DDEV PHPStan" extension will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [Unreleased] +All notable changes to this project will be documented in this file. This project uses [Release Please](https://github.com/googleapis/release-please) to automate releases and changelog management. ## [0.4.2] - 2025-10-01 diff --git a/package-lock.json b/package-lock.json index 226454e..0d4c7d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vscode-ddev-phpstan", - "version": "0.4.2", + "version": "0.5.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "vscode-ddev-phpstan", - "version": "0.4.2", + "version": "0.5.0", "license": "GPL-3.0", "devDependencies": { "@types/mocha": "^10.0.9", @@ -26,7 +26,7 @@ "typescript": "^5.9.3" }, "engines": { - "vscode": "^1.100.0" + "vscode": "^1.108.0" } }, "node_modules/@azu/format-text": {