-
Notifications
You must be signed in to change notification settings - Fork 20
97 lines (83 loc) · 2.55 KB
/
publish-to-vscode.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# This is a basic workflow to help you get started with Actions
name: 📦 Publish To Vscode
env:
FORCE_COLOR: true
on:
workflow_dispatch:
push:
tags:
- "v*"
jobs:
test:
name: 📋 Unit Test
uses: ./.github/workflows/unit-test.yml
universal:
runs-on: windows-latest
name: 📦 Create universal build
steps:
- name: 📦 Checkout Repository
uses: actions/checkout@v4
with:
submodules: true
- name: 🏗️ Setup Node.js Environment
uses: actions/setup-node@v4
with:
cache: npm
cache-dependency-path: package-lock.json
node-version-file: .nvmrc
- name: Setup Node Project
run: npm install
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 🛠️ Build
env:
VSCE_PAT: ${{ secrets.vsce }}
run: |
npx vsce package
echo "Size of package: $(du -h *.vsix | cut -f1)" >> $GITHUB_STEP_SUMMARY
- name: 🚚 Upload Artifact
uses: actions/upload-artifact@v4
with:
name: universal
path: "*.vsix"
## Check if the webpacked version is still good
- name: 📋 Test
run: npm run test
- name: 🔍 Linting
run: npm run lint
publish:
if: ${{ needs.test.result == 'success' && needs.universal.result == 'success' }}
runs-on: ubuntu-latest
needs: [universal, test]
name: 📦 -> 🏤 Publish To Vscode
environment:
name: Vscode Marketplace
url: https://marketplace.visualstudio.com/items?itemName=BlockceptionLtd.blockceptionvscodeminecraftbedrockdevelopmentextension
steps:
- name: 🚚 Download Artifact
uses: actions/download-artifact@v4
- name: 📦 -> 🏤 Upload to Vscode
run: npx @vscode/vsce publish --packagePath $(find . -iname *.vsix)
env:
VSCE_PAT: ${{ secrets.vsce }}
tagged-release:
name: 📑 Release Page
runs-on: "ubuntu-latest"
if: ${{ needs.universal.result == 'success' }}
needs:
- universal
steps:
- name: 📦 Checkout Repository
uses: actions/checkout@v4
- name: 🚚 Download Artifact
id: download-artifact
uses: actions/download-artifact@v4
with:
name: universal
- name: 📑 Release Page
uses: ncipollo/release-action@v1
with:
token: "${{ secrets.GITHUB_TOKEN }}"
generateReleaseNotes: true
makeLatest: true
artifacts: ${{ steps.download-artifact.outputs.download-path }}/*.vsix