Skip to content

Commit

Permalink
fix: Adjust release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
DominiqueLade committed Oct 8, 2024
1 parent 6713485 commit 358916e
Showing 1 changed file with 11 additions and 21 deletions.
32 changes: 11 additions & 21 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,49 +18,39 @@ jobs:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.GIT_PAT }}
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node

build-and-publish:
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
runs-on: ubuntu-latest
environment: release

steps:
- name: Checkout code
if: ${{ steps.release.outputs.release_created }}
uses: actions/checkout@v3

- name: Setup Node.js
if: ${{ steps.release.outputs.release_created }}
uses: actions/setup-node@v3
with:
node-version: "20"

- name: Install dependencies
if: ${{ steps.release.outputs.release_created }}
run: npm ci

- name: Install vsce
if: ${{ steps.release.outputs.release_created }}
run: npm install -g @vscode/vsce

- name: Package extension
if: ${{ steps.release.outputs.release_created }}
run: vsce package

- name: Get VSIX filename
if: ${{ steps.release.outputs.release_created }}
id: get-vsix-filename
run: echo "VSIX_FILENAME=$(ls *.vsix)" >> $GITHUB_OUTPUT

- name: Publish to Visual Studio Marketplace
if: ${{ steps.release.outputs.release_created }}
run: vsce publish -p ${{ secrets.VSCE_PAT }}
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}

- name: Upload VSIX as release asset
if: ${{ steps.release.outputs.release_created }}
uses: actions/upload-release-asset@v1
- name: Upload Release Artifact
env:
GITHUB_TOKEN: ${{ secrets.GIT_PAT }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ steps.get-vsix-filename.outputs.VSIX_FILENAME }}
asset_name: ${{ steps.get-vsix-filename.outputs.VSIX_FILENAME }}
asset_content_type: application/octet-stream
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ needs.release-please.outputs.tag_name }} *.vsix

0 comments on commit 358916e

Please sign in to comment.