-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (53 loc) · 1.72 KB
/
Publish.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Publish
on:
workflow_dispatch:
inputs:
prerelease:
description: 'Pre-release'
type: boolean
required: false
default: false
dry_run_marketplace:
description: 'Dry Run (Marketplace) (Do not publish)'
type: boolean
required: false
default: false
dry_run_gh_releases:
description: 'Dry Run (GitHub Releases) (Do not publish)'
type: boolean
required: false
default: false
jobs:
build:
name: Build
uses: ./.github/workflows/Build.yaml
publish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: soberjs-vscode-${{ needs.build.outputs.extension-version }}.vsix
path: ./
- name: Extract Artifact
shell: bash
run: |
unzip *.zip
echo "extensionFileName=soberjs-vscode-${{ needs.build.outputs.extension-version }}.vsix >> $GITUHB_ENV"
- name: Publish to Visual Studio Marketplace
uses: HaaLeo/publish-vscode-extension@v1
if: ${{ ! inputs.prerelease }}
with:
pat: ${{ secrets.AZURE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
extensionFile: ./${{ env.extensionFileName }}
dryRun: ${{ inputs.dry_run_marketplace }}
- name: Publish to GitHub Releases
uses: softprops/action-gh-release@v2
if: ${{ ! inputs.dry_run_gh_releases }}
with:
files: ./${{ env.extensionFileName }}
tag_name: v${{ needs.build.outputs.extension-version }}
prerelease: ${{ inputs.prerelease }}
target_commitish: ${{ needs.build.outputs.commit-hash }}