-
-
Notifications
You must be signed in to change notification settings - Fork 131
82 lines (74 loc) · 2.46 KB
/
manual-publish.yml
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# This is a basic workflow that is manually triggered
name: ' 🚀 Publish to Marketplace'
# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
workflow_dispatch:
inputs:
ref:
description: The release TAG to publish. i.e. `v2.3.0`
required: true
default: 'v2.3.0'
workflow_call:
inputs:
ref:
type: string
required: true
secrets:
OVSX_TOKEN:
required: true
VSCE_TOKEN:
required: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Get Package Version
id: version
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const manifest = JSON.parse(fs.readFileSync('package.json', 'utf8'));
const version = manifest.version;
core.setOutput('version', version);
- name: Display Info
uses: streetsidesoftware/actions/public/summary@v1
with:
text: |
# Package Info
ref: ${{ inputs.ref }}
version: `${{ steps.version.outputs.version }}`
- name: Test Exit
run: |
echo "::error title=Test::This is a test error"
exit 1
- name: Install
run: |
npm install
npm run build
- name: Build Extension .vsix
run: npm run package-extension
- name: Publish VSCE
run: >
find ./build -name "*.vsix" | xargs npx vsce publish --skip-duplicate -p ${{ secrets.VSCE_TOKEN }} --packagePath
|| echo "PUB_FAIL_VSCE=true" >> $GITHUB_ENV
- name: Check Publish Result VSCE
if: ${{ env.PUB_FAIL_VSCE }}
run: echo "::error title=VSCE::Failed to Publish to VS Code Marketplace."
- name: Publish OVSX
run: >
find ./build -name "*.vsix" | xargs npx ovsx publish --skip-duplicate -p ${{ secrets.OVSX_TOKEN }}
|| echo "PUB_FAIL_OVSX=true" >> $GITHUB_ENV
- name: Check Publish Result OVSX
if: ${{ env.PUB_FAIL_OVSX }}
run: echo "::error title=OVSX::Failed to Publish to Eclipse Open VSX."
- name: Check Build
if: ${{ env.PUB_FAIL_VSCE || env.PUB_FAIL_OVSX }}
run: exit 1
# cspell:ignore vsix xargs OVSX