-
Notifications
You must be signed in to change notification settings - Fork 2
155 lines (137 loc) · 4.78 KB
/
release.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
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
148
149
150
151
152
153
154
155
name: Release Visual Studio Code packages
on:
push:
tags:
- v*
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
uses: ./.github/workflows/test.yaml
with:
os: ${{ matrix.os }}
secrets: inherit
build:
runs-on: ${{ matrix.os }}
needs: test
strategy:
matrix:
# https://code.visualstudio.com/api/working-with-extensions/publishing-extension#platformspecific-extensions
# https://nodejs.org/api/process.html#processarch
# https://doc.rust-lang.org/nightly/rustc/platform-support.html
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
vsce-target: win32-x64
npm-config-arch: x64
- os: windows-latest
target: aarch64-pc-windows-msvc
vsce-target: win32-arm64
npm-config-arch: arm64
- os: ubuntu-20.04
target: x86_64-unknown-linux-gnu
vsce-target: linux-x64
npm-config-arch: x64
- os: ubuntu-20.04
target: aarch64-unknown-linux-gnu
vsce-target: linux-arm64
npm-config-arch: arm64
- os: macos-latest
target: x86_64-apple-darwin
vsce-target: darwin-x64
npm-config-arch: x64
- os: macos-latest
target: aarch64-apple-darwin
vsce-target: darwin-arm64
npm-config-arch: arm64
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
- name: Install dependencies
env:
npm_config_arch: ${{ matrix.npm-config-arch }}
run: yarn install --frozen-lockfile
# Auto-downloads the platform specific language server
# (see https://github.com/ink-analyzer/ink-vscode/blob/master/setup.js).
- name: Build packages
env:
npm_config_arch: ${{ matrix.npm-config-arch }}
INK_ANALYZER_ARCH: ${{ matrix.npm-config-arch }}
INK_ANALYZER_SKIP_VERIFY: true
# Used by the setup script,
# otherwise we sometimes get hit by rate limits when determining the latest release from the GitHub API.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx vsce package --yarn -o ink-analyzer-${{ matrix.vsce-target }}.vsix --target ${{ matrix.vsce-target }}
- name: Upload packages
uses: actions/upload-artifact@v4
with:
name: ink-analyzer-${{ matrix.vsce-target }}.vsix
path: ink-analyzer-${{ matrix.vsce-target }}.vsix
release:
runs-on: ubuntu-latest
needs: [test, build]
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
- name: Install dependencies
env:
npm_config_arch: ${{ matrix.npm-config-arch }}
run: yarn install --frozen-lockfile
# Download Windows packages.
- uses: actions/download-artifact@v4
with:
name: ink-analyzer-win32-x64.vsix
path: dist
- uses: actions/download-artifact@v4
with:
name: ink-analyzer-win32-arm64.vsix
path: dist
# Download Linux packages.
- uses: actions/download-artifact@v4
with:
name: ink-analyzer-linux-x64.vsix
path: dist
- uses: actions/download-artifact@v4
with:
name: ink-analyzer-linux-arm64.vsix
path: dist
# Download macOS packages.
- uses: actions/download-artifact@v4
with:
name: ink-analyzer-darwin-x64.vsix
path: dist
- uses: actions/download-artifact@v4
with:
name: ink-analyzer-darwin-arm64.vsix
path: dist
# Prepare the release.
- name: List all downloaded packages
run: ls -la dist
- name: Extract release notes from the changelog
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v2
with:
changelog_file: CHANGELOG.md
- name: Create a GitHub Release and upload all packages
env:
npm_config_arch: ${{ matrix.npm-config-arch }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --notes '${{ steps.extract-release-notes.outputs.release_notes }}' dist/*
# Publish packages.
- name: Publish all packages to Visual Studio Code Marketplace
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
INK_ANALYZER_SKIP_SETUP: true
run: npx vsce publish --yarn --packagePath $(find ./dist -iname ink-analyzer-*.vsix)