Skip to content

Commit

Permalink
Merge pull request #570 from fendor/fix/release-script
Browse files Browse the repository at this point in the history
Simplify release script
  • Loading branch information
fendor authored Apr 5, 2022
2 parents 6cf8fa0 + e15b8e4 commit 74f06ca
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ on:

name: Deploy Extension
jobs:
build-vsix:
publish-extension:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 17
- run: yarn install --immutable --immutable-cache --check-cache

- name: Package Extension
id: packageExtension
uses: HaaLeo/publish-vscode-extension@v1
Expand All @@ -21,42 +22,33 @@ jobs:
preRelease: ${{ github.event.action == 'prereleased' }}
yarn: true

## Make sure the artifact is added to the release.
- name: Upload extension vsix to workflow artifacts
uses: actions/upload-artifact@v3
with:
name: haskell-${{ github.event.release.tag_name }}.vsix
path: ${{ steps.packageExtension.outputs.vsixPath }}
outputs:
vsixPath: ${{ steps.packageExtension.outputs.vsixPath }}

## If this is a release job, publish to VSCode,
## otherwise publish a pre-release to VSCode
deploy-vs:
runs-on: ubuntu-latest
needs: [build-vsix]
steps:
## If this is a release job, publish to VSCode,
## otherwise publish a pre-release to VSCode
- name: Publish to Visual Studio Marketplace
id: publishToVSMarketplace
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
extensionFile: ${{ needs.build-vsix.outputs.vsixPath }}
extensionFile: ${{ steps.packageExtension.outputs.vsixPath }}
yarn: true
preRelease: ${{ github.event.action == 'prereleased' }}

## Publish to VSX iff this is a release
deploy-vsx:
runs-on: ubuntu-latest
needs: [build-vsix]
# Run this job only on release, VSX doesn't support pre-releases yet
if: ${{ github.event.action == 'released' }}
steps:
# Run this job only on release, VSX doesn't support pre-releases yet
- name: Publish to Open VSX Registry
id: publishToOpenVSX
if: ${{ github.event.action == 'released' }}
continue-on-error: true
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.OPEN_VSX_TOKEN }}
extensionFile: ${{ needs.build-vsix.outputs.vsixPath }}
extensionFile: ${{ steps.packageExtension.outputs.vsixPath }}
yarn: true
preRelease: ${{ github.event.action == 'prereleased' }}

0 comments on commit 74f06ca

Please sign in to comment.