6
6
description : Optional release tag (normally auto-detected)
7
7
8
8
jobs :
9
- build :
9
+ get-version :
10
10
runs-on : ubuntu-latest
11
- container : ghcr.io/orbitalquark/textadept-build:v1.0
12
11
outputs :
13
- version : ${{ steps.build .outputs.version }}
12
+ version : ${{ steps.get-version .outputs.version }}
14
13
steps :
15
14
- name : Checkout
16
- uses : actions/checkout@v2
17
- - name : Git init if necessary
18
- shell : bash
15
+ uses : actions/checkout@v4
16
+
17
+ - name : Get version
18
+ id : get-version
19
19
run : |
20
- # If git version is less than 2.18, a git clone will not be made in this container. In
21
- # that case, make a temporary repository so "make release" can archive the repo's
22
- # contents for release.
23
- if [[ -d .git ]]; then exit 0; fi
24
- git init
25
- git add .
26
- git config --global user.email "none@example.com"
27
- git config --global user.name "none"
28
- git commit -m 'none'
20
+ version="${{ github.event.inputs.tag }}"
21
+ if [[ -z "$version" ]]; then
22
+ version=`grep -m1 '###' docs/changelog.md | cut -d ' ' -f 2`
23
+ fi
24
+ echo "version=$version" >> "$GITHUB_OUTPUT"
25
+
26
+ build :
27
+ strategy :
28
+ matrix :
29
+ os : [ubuntu-20.04, windows-2019]
30
+ runs-on : ${{ matrix.os }}
31
+ steps :
32
+ - name : Checkout
33
+ uses : actions/checkout@v4
34
+
29
35
- name : Checkout textadept-build dependencies
30
- uses : actions/checkout@v2
36
+ uses : actions/checkout@v4
31
37
with :
32
38
repository : orbitalquark/textadept-build
33
39
path : textadept-build
40
+
34
41
- name : Build
35
- id : build
36
42
shell : bash
37
43
run : |
38
- # Move cached dependencies into current dir.
39
- mv textadept-build/* .
40
- rm -r textadept-build
44
+ # Move cached dependencies into build/_deps.
45
+ mkdir -p build/_deps && mv textadept-build/* build/_deps && rm -r textadept-build
41
46
42
47
# Build.
43
- make deps docs
44
- make release
48
+ cmake -S . -B build
49
+ cmake --build build --config Release
50
+ cmake --install build
45
51
46
- # Output version information for use in later steps.
47
- version="${{ github.event.inputs.tag }}"
48
- if [[ -z $version ]]; then
49
- version=`ls -1 scintillua_*.zip | head -1 | sed 's/[^_]\+_\(.\+\)\.zip/\1/;'`
50
- fi
51
- echo "::set-output name=version::$version"
52
52
- name : Upload artifacts
53
53
uses : actions/upload-artifact@v4
54
54
with :
55
- name : artifacts
55
+ name : artifacts-${{ matrix.os }}
56
56
path : |
57
- scintillua_*
58
- docs/changelog.md
59
- tag :
57
+ lexers/*.so
58
+ lexers/*.dll
59
+
60
+ release :
60
61
runs-on : ubuntu-latest
61
- needs : build
62
+ needs : [get-version, build]
62
63
steps :
63
64
- name : Checkout
64
65
uses : actions/checkout@v4
65
- - name : Tag
66
- run : |
67
- git tag scintillua_${{ needs.build.outputs.version }}
68
- git push -f origin scintillua_${{ needs.build.outputs.version }}
69
- release :
70
- runs-on : ubuntu-latest
71
- needs : [build, tag]
72
- steps :
66
+ with :
67
+ path : scintillua
68
+
73
69
- name : Download artifacts
74
70
uses : actions/download-artifact@v4
75
71
with :
76
- name : artifacts
72
+ path : scintillua/lexers
73
+ merge-multiple : true
74
+
75
+ - name : Generate HTML documentation
76
+ run : |
77
+ sudo apt-get update
78
+ sudo apt-get install lua5.4 discount --no-install-recommends -y
79
+ cd scintillua && ./gen_docs.sh
80
+
81
+ - name : Tag
82
+ if : github.ref_name == github.event.repository.default_branch
83
+ run : |
84
+ git tag scintillua_${{ needs.get-version.outputs.version }}
85
+ git push -f origin scintillua_${{ needs.get-version.outputs.version }}
86
+
77
87
- name : Create release log
78
- shell : bash
79
88
run : |
80
89
echo -n "Scintillua " > log.md
81
- echo -n "${{ needs.build .outputs.version }} " >> log.md
90
+ echo -n "${{ needs.get-version .outputs.version }} " >> log.md
82
91
echo \(`date +"%d %b %Y"`\) >> log.md
83
92
prefix="https://orbitalquark.github.io/scintillua"
84
93
echoing=0
@@ -92,13 +101,26 @@ jobs:
92
101
elif [[ $echoing -eq 1 ]]; then
93
102
echo "$line" | sed "s,\(manual\|api\)\.html,$prefix/\0,;"
94
103
fi
95
- done < docs/changelog.md >> log.md
104
+ done < scintillua/docs/changelog.md >> log.md
105
+
106
+ - name : Generate archive
107
+ run : zip -r scintillua_${{ needs.get-version.outputs.version }}.zip scintillua
108
+
109
+ - name : Upload artifacts
110
+ uses : actions/upload-artifact@v4
111
+ with :
112
+ name : artifacts-release
113
+ path : |
114
+ log.md
115
+ scintillua_${{ needs.get-version.outputs.version }}.zip
116
+
96
117
- name : Create release
118
+ if : github.ref_name == github.event.repository.default_branch
97
119
uses : ncipollo/release-action@v1
98
120
with :
99
121
name : ${{ needs.build.outputs.version }}
100
122
tag : scintillua_${{ needs.build.outputs.version }}
101
123
allowUpdates : true
102
124
bodyFile : log.md
103
- artifacts : scintillua_*
125
+ artifacts : scintillua_${{ needs.get-version.outputs.version }}.zip
104
126
token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments