-
Notifications
You must be signed in to change notification settings - Fork 4
73 lines (61 loc) · 2.26 KB
/
publish.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Publish Extension
# This workflow publish the extension when a new tag is pushed
on:
push:
tags:
- '*'
jobs:
# check_tag:
# name: Check triggering tag
# runs-on: ubuntu-latest
# if: startsWith(github.ref, 'refs/tags/')
# steps:
# - name: Clone
# uses: actions/checkout@v4
# - name: Registry public GPG keys
# run: |
# # GPG key IDs for: Alexis, Charles-Edouard, François, Lucas, Salvatore, Thibault, Jerome, Alexandre
# for KEY_ID in "379AF176C6D52F83E9736990A79EF4F0F526AE4A C03916B76970ED7AB902D52BF12296941B7BB9C6 763B76BB1B926101964E382C055EEF69B9C236CE AF9CF33EAE2B3BD439F7E11D5F1747DCE1C18102 9F4011447A639254CE48657674060FF81B33E4F8 38AA2C508024B54225F5692873292661EA52A368 464D20F010CB38828F38E6C91EEAE88A0B76D420 1CFD49E93E9D1F8E9681D2B56A43DCB4AD8ED025"; \
# do \
# gpg --keyserver hkps://keyserver.ledgerlabs.net --recv-keys ${KEY_ID}; \
# done
# - name: Verify the tag
# run: |
# git fetch -aptf
# git tag -v ${{ github.ref_name }}
check_changelog:
name: Check changelog versions
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Clone
uses: actions/checkout@v4
- name: Get CHANGELOG version
run: |
echo "CHANGELOG_VERSION=$(grep -Po '(?<=## \[)(\d\.)+[^\]]' CHANGELOG.md | head -n 1)" >> "$GITHUB_ENV"
- name: Check tag version against CHANGELOG version
if: startsWith(github.ref, 'refs/tags/')
run: |
if [ "${{ github.ref_name }}" != "${CHANGELOG_VERSION}" ]; then
echo "Tag '${{ github.ref_name }}' and CHANGELOG '${CHANGELOG_VERSION}' versions mismatch!"
exit 1
fi
publish:
name: Publish the extension
runs-on: ubuntu-latest
# needs: [check_tag, check_changelog]
needs: [check_changelog]
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Clone
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: node
- name: Packages installation
run: npm install @vscode/vsce --save-dev
- name: Publish to Visual Studio Marketplace
run: npm run deploy
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}