-
Notifications
You must be signed in to change notification settings - Fork 2
94 lines (80 loc) · 2.55 KB
/
Copy pathbuild.yml
File metadata and controls
94 lines (80 loc) · 2.55 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
name: build vscode extension
on:
push:
tags:
- "*"
permissions:
contents: write
jobs:
vscode:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 10
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 23.11.0
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Build extension
run: pnpm run vscode:publish
- run: |
cd $GITHUB_WORKSPACE
ls -al
git fetch --all
git fetch --tags
git tag -l
LATEST_TAG=`git tag --sort=refname |tail -n 2 |head -n 1`
echo "LATEST_TAG: $LATEST_TAG"
NEW_TAG=`git tag --sort=refname |tail -n 1`
echo "NEW_TAG: $NEW_TAG"
git log --format='%(trailers:key=Type,valueonly,separator=%x20)%x1c%s [%(trailers:key=Issue,valueonly,separator=,)]' $LATEST_TAG..$NEW_TAG | awk -F "\034" '{
gsub(/\[\]$/, "", $2);
if (length($1) == 0) $1="";
if (!($1 in item_count)) item_count[$1]=0;
items[$1, item_count[$1]]=$2;
item_count[$1]++;
}
END {
for (k in item_count) {
print k;
k2=k;
gsub(/./, "-", k2);
print k2
for (i=0; i<item_count[k]; i++) print "- "items[k, i];
print ""
}
}' > commit_notes
echo "## Version Change Log $NEW_TAG" >> version.txt
echo " " >> version.txt
echo '```' >> version.txt
cat commit_notes >> version.txt
echo '```' >> version.txt
- run: |
cat > zshrc_helper << EOF
weapon_vscode_launch_helper () {
if [ -n "$PROJECT_FOLDER" ]; then
if [ -f "$PROJECT_FOLDER/.vscode/.zshrc" ]; then
source $PROJECT_FOLDER/.vscode/.zshrc
fi
fi
}
weapon_vscode_launch_helper
EOF
- name: Create Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body_path: ${{ github.workspace }}/version.txt
files: |
${{ github.workspace }}/weaponized-0.0.1.vsix
${{ github.workspace }}/commit_notes
${{ github.workspace }}/zshrc_helper