-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·141 lines (125 loc) · 5.36 KB
/
vsix-generation.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage.
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml
name: VSIX Generation
on:
push:
tags: [ "[0-9]+.[0-9]+.[0-9]+*" ]
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Fetch dependencies
run: npm install
- name: Build
run: npm run publish
- name: Rename file
run: mv diplomat-host-*.vsix diplomat-host-${{ github.ref_name }}.vsix
- name: Upload artifacts - main app
uses: actions/upload-artifact@v4
if: ${{ success() }}
with:
name: diplomat-vscode-${{ github.ref_name }}
path: ${{github.workspace}}/diplomat-host-${{ github.ref_name }}.vsix
overwrite: true
if-no-files-found: error
# Is a binary
compression-level: 0
- name: Upload artifacts - CHANGELOG
uses: actions/upload-artifact@v4
if: ${{ success() }}
with:
name: CHANGELOG-${{ github.ref_name }}
path: ${{github.workspace}}/CHANGELOG.md
overwrite: true
if-no-files-found: error
light-debug:
if: false
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DDIPLOMAT_VERSION=${{ github.ref_name }}
- name: Upload artifacts - CHANGELOG
uses: actions/upload-artifact@v4
if: ${{ success() }}
with:
name: CHANGELOG-${{ github.ref_name }}
path: ${{github.workspace}}/CHANGELOG.md
overwrite: true
if-no-files-found: error
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Process release version
id: semver
uses: madhead/semver-utils@latest
with:
version: ${{ github.ref_name }}
lenient: false
- run: |
echo "Tag : ${{github.ref_name}}"
echo "Release : ${{steps.semver.outputs.release}}"
echo "N Build : ${{steps.semver.outputs.build-parts}}"
- name: Retrieve changelog
if: ${{ success() }}
uses: actions/download-artifact@v4
with:
name: CHANGELOG-${{ github.ref_name }}
- name: Extract changelog
run: |
head -n $((`grep -n -m 2 '^# ' ${{github.workspace}}/CHANGELOG.md | sed 's/:.\+//g' | tail -n 1`-1)) ${{github.workspace}}/CHANGELOG.md > ${{github.workspace}}/RELNOTES.md
cat ${{github.workspace}}/RELNOTES.md
- name: Retrieve artifact
if: ${{ success() }}
uses: actions/download-artifact@v4
with:
name: diplomat-vscode-${{ github.ref_name }}
- name: Create main release from tag
if: ${{ success() && steps.semver.outputs.release == github.ref_name}}
uses: softprops/action-gh-release@v2
with:
body_path: ${{github.workspace}}/RELNOTES.md
make_latest: true
prerelease: false
files: |
diplomat-host-${{ github.ref_name }}.vsix
- name: Create dev release from tag
if: ${{ success() && steps.semver.outputs.release != github.ref_name }}
uses: softprops/action-gh-release@v2
with:
body_path: ${{github.workspace}}/RELNOTES.md
make_latest: false
prerelease: true
name: "Latest Dev Release"
files: |
diplomat-host-${{ github.ref_name }}.vsix
- uses: actions/checkout@v4
if: ${{ success() }}
- name: Update latest branch
if: ${{ success() }}
uses: EndBug/latest-tag@latest
with:
# You can change the name of the tag or branch with this input.
# Default: 'latest'
# ref: someCustomTagName
# If a description is provided, the action will use it to create an annotated tag. If none is given, the action will create a lightweight tag.
# Default: ''
# description: Description for the tag
# Force-update a branch instead of using a tag.
# Default: false
force-branch: true
# - name: Test
# working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
# run: ctest -C ${{env.BUILD_TYPE}}