-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (70 loc) · 2.96 KB
/
release-please.yml
File metadata and controls
78 lines (70 loc) · 2.96 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
name: Release Please
on:
push:
branches:
- main
- master
permissions:
contents: write
pull-requests: write
repository-projects: read # needed for 'gh pr edit' https://github.com/cli/cli/issues/6274
jobs:
release-please:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
-
name: Checkout repository
id: checkout
uses: actions/checkout@v4
# Step 2: Release Please Action
- name: Release Please Action
uses: googleapis/release-please-action@v4
id: release
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
token: ${{ secrets.GITHUB_TOKEN }}
# Step 3: Set Environment Variable Based on Release Created
-
name: Set Environment Variable
id: detect-release
if: ${{ steps.release.outputs.releases_created == 'true' }}
run: |
if [[ "${{ steps.release.outputs['extensions/scripts--release_created'] }}" == "true" ]]; then
echo "working_folder=extensions/scripts" >> $GITHUB_ENV
echo "current_version=${{ steps.release.outputs['extensions/scripts--major'] }}.${{ steps.release.outputs['extensions/scripts--minor'] }}.${{ steps.release.outputs['extensions/scripts--patch'] }}" >> $GITHUB_ENV
echo "tag_name=${{ steps.release.outputs['extensions/scripts--tag_name'] }}" >> "$GITHUB_OUTPUT"
elif [[ "${{ steps.release.outputs['extensions/lua--release_created'] }}" == "true" ]]; then
echo "working_folder=extensions/lua" >> $GITHUB_ENV
echo "current_version=${{ steps.release.outputs['extensions/lua--major'] }}.${{ steps.release.outputs['extensions/lua--minor'] }}.${{ steps.release.outputs['extensions/lua--patch'] }}" >> $GITHUB_ENV
echo "tag_name=${{ steps.release.outputs['extensions/lua--tag_name'] }}" >> "$GITHUB_OUTPUT"
fi
# Step 4: Setup Node.js environment
-
name: Setup Node.js environment
if: ${{ steps.release.outputs.releases_created == 'true' }}
uses: actions/setup-node@v4.3.0
with:
node-version: '22'
check-latest: true
# Step 5: Build and Publish Extension .vsix
-
name: Build and Publish Extension .vsix
if: ${{ steps.release.outputs.releases_created == 'true' }}
run: |
cd ${working_folder}
npm ci
npm install -g vsce
vsce package
vsce publish -p ${{ secrets.VSCE_PAT }} --no-update-package-json --no-git-tag-version ${current_version}
# Step 6: Attach Extension .vsix to Release
-
name: Attach Extension .vsix to Release
if: ${{ steps.release.outputs.releases_created == 'true' }}
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ steps.detect-release.outputs['tag_name'] }}
files: |
extensions/*/*.vsix