chore: Add VS Code extension build to Github release workflow

This commit is contained in:
Sam Tolmay 2024-07-31 16:06:01 +02:00
parent 7971fe7dda
commit f1e33e0830
No known key found for this signature in database
2 changed files with 18 additions and 62 deletions

View File

@ -1,62 +0,0 @@
name: release
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
build_release:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: setup node
uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install
- run: npx changeset version
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@v1.3.1
- name: git
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
git add .
git commit -m "Version packages"
git push
- run: npx vsce package
- name: release
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: false
release_name: Release v${{ steps.package-version.outputs.current-version}}
tag_name: v${{ steps.package-version.outputs.current-version}}
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ github.token }}
- name: upload windows artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }} # This token is provided by Actions, you do not need to create your own token
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./lowdefy-vscode-${{ steps.package-version.outputs.current-version}}.vsix
asset_name: lowdefy-vscode-${{ steps.package-version.outputs.current-version}}.vsix
asset_content_type: application/zip
## TODO: Publish extension

View File

@ -41,3 +41,21 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Package VS Code Extention
run: pnpm --filter lowdefy-vscode package
- name: Print changesets steps context
env:
CONTEXT: ${{ toJson(steps.changesets) }}
run: echo "$CONTEXT"
- name: Create Github Release
uses: softprops/action-gh-release@v2
if: ${{ steps.changesets.outputs.published }}
with:
tag_name: ${{ format('v{0}', fromJSON(steps.changesets.outputs.publishedPackages)[0].version) }}
draft: true
files: |
lowdefy-vscode-*.vsix
target_commitish: ${{ github.sha }}