aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/release.yml147
1 files changed, 147 insertions, 0 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 00000000..87aab5a0
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,147 @@
1name: release
2
3on:
4 push:
5 tags:
6 - "v*"
7 pull_request:
8
9jobs:
10 release:
11 runs-on: "ubuntu-latest"
12
13 steps:
14 - uses: actions/checkout@master
15
16 - name: check repository state
17 run: |
18 tag="${{ github.ref_name }}"
19 version="${tag#v}"
20 xyversion="${version%.*}"
21 grep -q "LuaRocks version $version" "configure" || {
22 echo
23 echo "version in configure is incorrect. Please fix it."
24 exit 1
25 }
26 grep -q "program_version = \"$version\"" src/luarocks/core/cfg.lua || {
27 echo
28 echo "program_version in src/luarocks/core/cfg.lua is incorrect. Please fix it."
29 exit 1
30 }
31 grep -q "vars.VERSION = \"$xyversion\"" install.bat || {
32 echo
33 echo "vars.VERSION in install.bat is incorrect. Please fix it."
34 exit 1
35 }
36
37 - name: make Unix tarball
38 run: |
39 tag="${{ github.ref_name }}"
40 version="${tag#v}"
41 lrdir="luarocks-$version"
42 out="unix_tarball/$lrdir"
43 mkdir -p "$out"
44 git ls-files | while read i
45 do
46 if [ -f "$i" ]
47 then
48 dir=`dirname $i`
49 mkdir -p "$out/$dir"
50 cp "$i" "$out/$dir"
51 fi
52 done
53 cd "$out"
54 rm -rf makedist install.bat win32 .github .gitignore
55 cd ..
56 tar czvpf ../"$lrdir.tar.gz" "$lrdir"
57
58 - name: make Windows legacy zip
59 run: |
60 tag="${{ github.ref_name }}"
61 version="${tag#v}"
62 lrdir="luarocks-$version-win32"
63 out="windows_legacy/$lrdir"
64 mkdir -p "$out"
65 git ls-files | while read i
66 do
67 if [ -f "$i" ]
68 then
69 dir=`dirname $i`
70 mkdir -p "$out/$dir"
71 cp "$i" "$out/$dir"
72 fi
73 done
74 cd "$out"
75 rm -rf makedist Makefile GNUmakefile configure .github .gitignore test
76 cd ..
77 zip -r ../"$lrdir.zip" "$lrdir"
78
79 - name: install Linux binary build deps
80 run: |
81 sudo apt install lua5.4 liblua5.4-dev
82
83 - name: build Linux binary
84 run: |
85 tag="${{ github.ref_name }}"
86 version="${tag#v}"
87 lrdir="luarocks-$version-linux-x86_64"
88 lua54dir="/usr"
89 ./configure --lua-version=5.4 --with-lua=$lua54dir
90 make binary
91 cd build-binary
92 mkdir "$lrdir"
93 cp luarocks.exe "$lrdir/luarocks"
94 cp luarocks-admin.exe "$lrdir/luarocks-admin"
95 zip "../$lrdir.zip" "$lrdir"/*
96
97 - name: install Windows 32-bit binary bulid deps
98 run: |
99 sudo apt install gcc-mingw-w64-i686
100
101 - name: build Windows 32-bit binary
102 run: |
103 tag="${{ github.ref_name }}"
104 version="${tag#v}"
105 lrdir="luarocks-$version-windows-32"
106 lua54dir="/usr"
107 ./configure --lua-version=5.4 --with-lua=$lua54dir
108 make windows-binary-32
109 cd build-windows-binary-i686-w64-mingw32
110 mkdir "$lrdir"
111 cp luarocks.exe "$lrdir/luarocks.exe"
112 cp luarocks-admin.exe "$lrdir/luarocks-admin.exe"
113 zip "../$lrdir.zip" "$lrdir"/*
114
115 - name: install Windows 64-bit binary bulid deps
116 run: |
117 sudo apt install gcc-mingw-w64-x86-64
118
119 - name: build Windows 64-bit binary
120 run: |
121 tag="${{ github.ref_name }}"
122 version="${tag#v}"
123 lrdir="luarocks-$version-windows-64"
124 lua54dir="/usr"
125 ./configure --lua-version=5.4 --with-lua=$lua54dir
126 make windows-binary-64
127 cd build-windows-binary-x86_64-w64-mingw32
128 mkdir "$lrdir"
129 cp luarocks.exe "$lrdir/luarocks.exe"
130 cp luarocks-admin.exe "$lrdir/luarocks-admin.exe"
131 zip "../$lrdir.zip" "$lrdir"/*
132
133 - name: push to Releases
134 env:
135 GITHUB_USER: ${{ github.actor }}
136 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
137 run: |
138 tag="${{ github.ref_name }}"
139 version="${tag#v}"
140 echo "LuaRocks $version" > release.txt
141 echo hub release create -F release.txt \
142 -a "luarocks-$version.tar.gz" \
143 -a "luarocks-$version-linux-x86_64.zip" \
144 -a "luarocks-$version-windows-32.zip" \
145 -a "luarocks-$version-windows-64.zip" \
146 "$tag"
147 ls