Bumps to v17.3.0 #15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish Stable | |
| on: | |
| push: | |
| branches: | |
| - main # 仅主分支 | |
| paths: | |
| - 'package.json' # 仅当 package.json 文件发生变化时触发 | |
| jobs: | |
| build: | |
| name: Publish Stable | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Check if version changed | |
| id: version_check | |
| run: | | |
| git fetch origin ${{ github.event.before }} | |
| PREV_VERSION=$(git show ${{ github.event.before }}:package.json | jq -r .version) | |
| CURR_VERSION=$(jq -r .version package.json) | |
| echo "Previous version: $PREV_VERSION" | |
| echo "Current version: $CURR_VERSION" | |
| if [ "$PREV_VERSION" == "$CURR_VERSION" ]; then echo "Version did not change, skipping workflow."; exit 78; fi | |
| - name: Setup node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v3 | |
| with: | |
| version: 10 | |
| - name: Setup Environment | |
| run: node -e "console.log('PACKAGE_VERSION=' + require('./package.json').version + '\nPACKAGE_NAME=' + require('./package.json').name + '-' + require('./package.json').version)" >> $GITHUB_ENV | |
| # - name: Verify versions | |
| # run: node -e "if ('refs/tags/v' + '${{ env.PACKAGE_VERSION }}' !== '${{ github.ref }}') { console.log('::error' + 'Version Mismatch. refs/tags/v' + '${{ env.PACKAGE_VERSION }}', '${{ github.ref }}'); throw Error('Version Mismatch')} " | |
| - name: Install | |
| run: pnpm install | |
| - name: Package extension | |
| run: pnpm run package | |
| - name: Publish Extension to VS Code Marketplace | |
| run: pnpm vsce publish --no-dependencies --packagePath ./${{ env.PACKAGE_NAME }}.vsix -p ${{ secrets.GITLENS_VSCODE_MARKETPLACE_PAT }} | |
| # - name: Publish extension to OpenVSIX | |
| # run: pnpm ovsx publish ./${{ env.PACKAGE_NAME }}.vsix -p ${{ secrets.GITLENS_OPENVSIX_PAT }} | |
| - name: Generate Changelog | |
| id: changelog | |
| uses: mindsers/changelog-reader-action@v2 | |
| with: | |
| version: ${{ env.PACKAGE_VERSION }} | |
| path: ./CHANGELOG.md | |
| - name: Create GitHub release | |
| id: create_release | |
| uses: softprops/action-gh-release@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref }} | |
| name: v${{ env.PACKAGE_VERSION }} | |
| body: ${{ steps.changelog.outputs.changes }} | |
| draft: false | |
| prerelease: false | |
| files: ./${{ env.PACKAGE_NAME }}.vsix |