-
Notifications
You must be signed in to change notification settings - Fork 19
147 lines (139 loc) · 4.25 KB
/
publish.yml
File metadata and controls
147 lines (139 loc) · 4.25 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Publish VSIX - GitHub
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and cache WASM dependencies
uses: ./.github/actions/build-wasm-deps
with:
build-artifacts-dir: ./media
- name: Download artifact - windows-x86_64
id: download-windows-x86_64
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: shader-slang/slang
file: 'slang-.*-windows-x86_64\.zip'
target: "./"
regex: true
- name: Download artifact - windows-aarch64
id: download-windows-aarch64
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: shader-slang/slang
file: 'slang-.*-windows-aarch64\.zip'
target: "./"
regex: true
- name: Download artifact - linux-x86_64
id: download-linux-x86_64
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: shader-slang/slang
file: 'slang-.*-linux-x86_64\.zip'
target: "./"
regex: true
- name: Download artifact - linux-aarch64
id: download-linux-aarch64
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: shader-slang/slang
file: 'slang-.*-linux-aarch64\.zip'
target: "./"
regex: true
- name: Download artifact - macos-x86_64
id: download-macos-x86_64
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: shader-slang/slang
file: 'slang-.*-macos-x86_64\.zip'
target: "./"
regex: true
- name: Download artifact - macos-aarch64
id: download-macos-aarch64
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: shader-slang/slang
file: 'slang-.*-macos-aarch64\.zip'
target: "./"
regex: true
- name: Copy Slang binaries and Build VSIX
run: |
export TAGNAME=${{ steps.download-windows-x86_64.outputs.version }}
export WIN32_X64_ZIP=slang-${TAGNAME:1}-windows-x86_64.zip
export WIN32_ARM64_ZIP=slang-${TAGNAME:1}-windows-aarch64.zip
export LINUX_X64_ZIP=slang-${TAGNAME:1}-linux-x86_64.zip
export LINUX_ARM64_ZIP=slang-${TAGNAME:1}-linux-aarch64.zip
export DARWIN_X64_ZIP=slang-${TAGNAME:1}-macos-x86_64.zip
export DARWIN_ARM64_ZIP=slang-${TAGNAME:1}-macos-aarch64.zip
source ./build_scripts/build-package.sh
for file in ./*.vsix
do
echo "Built VSIX: $file"
done
- uses: actions/cache/save@v4
id: cache
with:
path: ./*.vsix
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
publish-github:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/cache/restore@v4
id: cache
with:
path: ./*.vsix
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
fail-on-cache-miss: true
- name: UploadSource
uses: softprops/action-gh-release@v1
with:
files: |
*.vsix
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-vscode:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/cache/restore@v4
id: cache
with:
path: ./*.vsix
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
fail-on-cache-miss: true
- name: Publish VSIX package to Visual Studio Marketplace
env:
VSCE_TOKEN: ${{ secrets.VS_MARKETPLACE_TOKEN }}
run: |
npm install -g @vscode/vsce
for file in ./*.vsix
do
vsce publish -p "$VSCE_TOKEN" --packagePath "$file"
echo "Published VSIX: $file"
done
publish-openvsx:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/cache/restore@v4
id: cache
with:
path: ./*.vsix
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
fail-on-cache-miss: true
- name: Publish VSIX package to Open VSX
env:
OVSX_TOKEN: ${{ secrets.OPEN_VSX_TOKEN }}
run: |
npm install -g ovsx
for file in ./*.vsix
do
ovsx publish -p "$OVSX_TOKEN" --packagePath "$file"
echo "Published VSIX: $file"
done