-
Notifications
You must be signed in to change notification settings - Fork 0
171 lines (139 loc) · 4.89 KB
/
Copy pathbuild-and-release.yml
File metadata and controls
171 lines (139 loc) · 4.89 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: Build and Release VS Code Extension
on:
push:
branches: [ main, develop, feature/* ]
tags: [ 'v*' ]
pull_request:
branches: [ main, develop ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run linter
run: npm run lint || true
- name: Run tests
run: npm test || true
- name: Build extension
run: npm run build
- name: Package extension
run: |
npm install -g vsce
vsce package --out sigscan-${{ github.sha }}.vsix
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: extension-${{ matrix.node-version }}-${{ github.sha }}
path: "*.vsix"
retention-days: 30
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build extension
run: npm run build
- name: Package extension for release
run: |
npm install -g vsce
vsce package
- name: Get version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: SigScan v${{ steps.get_version.outputs.VERSION }}
body: |
## 🚀 SigScan v${{ steps.get_version.outputs.VERSION }}
### Features
- Enhanced signature organization with separate files for contracts, libraries, and tests
- Automatic deduplication of signatures to avoid repetition
- File watching with incremental updates
- Automatic .gitignore updates for signatures folder
- Improved library contract filtering (only inherited contracts)
### Installation
Download the `.vsix` file below and install it via:
```
code --install-extension sigscan-${{ steps.get_version.outputs.VERSION }}.vsix
```
Or use the VS Code Extensions panel: `Extensions > Views and More Actions... > Install from VSIX...`
### What's Changed
- Signatures are now organized in separate files: `signatures-contracts.txt`, `signatures-libs.txt`, `signatures-tests.txt`
- Duplicate signatures (like vm.prank, assertTrue in tests) are automatically removed
- Only inherited library contracts are included in signatures-libs.txt
- Existing signature files are updated instead of creating new timestamped files
- Automatic file watching for real-time updates
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./sigscan-${{ steps.get_version.outputs.VERSION }}.vsix
asset_name: sigscan-${{ steps.get_version.outputs.VERSION }}.vsix
asset_content_type: application/zip
- name: Copy to releases directory
run: |
mkdir -p releases
cp sigscan-${{ steps.get_version.outputs.VERSION }}.vsix releases/
- name: Commit and push to releases
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add releases/
git commit -m "Add release v${{ steps.get_version.outputs.VERSION }}" || exit 0
git push origin main || exit 0
publish-marketplace:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build extension
run: npm run build
- name: Publish to VS Code Marketplace
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
run: |
if [ -n "$VSCE_PAT" ]; then
npm install -g vsce
vsce publish -p $VSCE_PAT
echo "Published to VS Code Marketplace"
else
echo "VSCE_PAT not set, skipping marketplace publication"
fi