forked from microsoft/vscode-azureresourcegroups
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (49 loc) · 1.63 KB
/
build-and-release.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
name: Build and Release
on:
push:
branches:
- wps # 您的主要分支
jobs:
buildAndRelease:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install Dependencies
run: npm install
- name: Run Package Script
run: npm run package
- name: Extract Version from package.json
id: version_step
run: |
package_version=$(node -p "require('./package.json').version")
echo "package_version=${package_version}" >> $GITHUB_OUTPUT
- name: Set vsix_filename
id: filename_step
run: echo "vsix_filename=$(ls *.vsix)" >> $GITHUB_OUTPUT
- name: Create Release
id: create_release
uses: actions/create-release@latest
with:
tag_name: ${{ steps.version_step.outputs.package_version }}
release_name: Release ${{ steps.version_step.outputs.package_version }}
body: Release notes for ${{ steps.version_step.outputs.package_version }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.filename_step.outputs.vsix_filename }}
asset_name: ${{ steps.filename_step.outputs.vsix_filename }}
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}