-
Notifications
You must be signed in to change notification settings - Fork 1
93 lines (76 loc) · 2.82 KB
/
Copy pathpublish.yml
File metadata and controls
93 lines (76 loc) · 2.82 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
name: Deploy VS Code Extension
on:
push:
tags:
- 'v*.*.*' # Triggers on tags like v0.1.2, v1.0.0, etc.
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Extract version from tag
id: get_version
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "Extracted version: $VERSION"
- name: Update package.json version
run: |
yarn version --new-version ${{ steps.get_version.outputs.VERSION }} --no-git-tag-version
echo "Updated package.json version to ${{ steps.get_version.outputs.VERSION }}"
- name: Install dependencies
run: yarn install --frozen-lockfile
# - name: Run linting
# run: yarn lint
# - name: Run tests
# run: yarn test
# continue-on-error: true # Continue if tests fail (optional)
- name: Build extension
run: yarn build-all
- name: Create VSIX package
run: yarn build-vsix
- name: Upload VSIX as artifact
uses: actions/upload-artifact@v4
with:
name: vsix-package
path: '*.vsix'
retention-days: 30
- name: Publish to VS Code Marketplace
run: yarn vsce publish --yarn --pat ${{ secrets.VSCODE_PAT }}
env:
VSCE_PAT: ${{ secrets.VSCODE_PAT }}
- name: Create GitHub Release
uses: actions/create-release@v1.1.4
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ steps.get_version.outputs.VERSION }}
body: |
## Changes in v${{ steps.get_version.outputs.VERSION }}
- Automated release from tag ${{ github.ref }}
- Built and published to VS Code Marketplace
### Installation
You can install this extension from:
- [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=vradchuk.git-smart-checkout)
- Download the VSIX file from this release and install manually
draft: false
prerelease: false
- name: Upload VSIX to GitHub Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./git-smart-checkout-${{ steps.get_version.outputs.VERSION }}.vsix
asset_name: git-smart-checkout-${{ steps.get_version.outputs.VERSION }}.vsix
asset_content_type: application/zip