-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (114 loc) · 3.59 KB
/
Copy pathrelease.yml
File metadata and controls
134 lines (114 loc) · 3.59 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
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build-release-artifacts:
name: Build ${{ matrix.os }} Release Artifact
runs-on: ${{ matrix.os }}
env:
JIK_CC: clang
VERSION: ${{ github.ref_name }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Windows toolchain paths
if: runner.os == 'Windows'
shell: pwsh
run: |
"C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
"C:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Show tool versions
shell: pwsh
run: |
Write-Output "VERSION=$env:VERSION"
Write-Output "JIK_CC=$env:JIK_CC"
clang --version
make --version
- name: Build
shell: pwsh
run: make
- name: Test
shell: pwsh
run: make test
- name: Build Release Archive
shell: pwsh
run: make release-archive VERSION=$env:VERSION
- name: Upload Release Artifact
uses: actions/upload-artifact@v4
with:
name: release-${{ runner.os }}
path: artifacts/*
if-no-files-found: error
build-vscode-release-artifact:
name: Build VS Code Extension Release Artifact
runs-on: ubuntu-latest
env:
RELEASE_TAG: ${{ github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install VSCE
shell: pwsh
run: npm install -g @vscode/vsce
- name: Validate VSIX Version
shell: pwsh
working-directory: tools/vscode-jik
run: |
$manifest = Get-Content package.json | ConvertFrom-Json
$tagVersion = $env:RELEASE_TAG
if ($tagVersion.StartsWith("v")) {
$tagVersion = $tagVersion.Substring(1)
}
if ($manifest.version -ne $tagVersion) {
Write-Error "Extension version '$($manifest.version)' in tools/vscode-jik/package.json does not match release tag '$env:RELEASE_TAG'. Expected '$tagVersion'."
}
Write-Output "VSIX version matches release tag: $tagVersion"
- name: Build VSIX
shell: pwsh
working-directory: tools/vscode-jik
run: |
$manifest = Get-Content package.json | ConvertFrom-Json
$vsixName = "{0}-{1}.vsix" -f $manifest.name, $env:RELEASE_TAG
Remove-Item *.vsix -Force -ErrorAction SilentlyContinue
node ./scripts/generate-stdlib-index.js
vsce package --out $vsixName
- name: Upload VSIX Release Artifact
uses: actions/upload-artifact@v4
with:
name: release-vscode
path: tools/vscode-jik/*.vsix
if-no-files-found: error
publish-release:
name: Publish GitHub Release
runs-on: ubuntu-latest
needs:
- build-release-artifacts
- build-vscode-release-artifact
steps:
- name: Download Release Artifacts
uses: actions/download-artifact@v4
with:
pattern: release-*
merge-multiple: true
path: release-artifacts
- name: Publish Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
files: release-artifacts/*
generate_release_notes: true