1 | # $Id: build.yml 266 2024-10-05 09:08:11Z nishi $
|
---|
2 |
|
---|
3 | name: "Build Tewi HTTPd"
|
---|
4 |
|
---|
5 | on:
|
---|
6 | workflow_dispatch:
|
---|
7 | inputs:
|
---|
8 | release:
|
---|
9 | description: "release or not"
|
---|
10 | type: boolean
|
---|
11 | default: true
|
---|
12 | required: true
|
---|
13 | push:
|
---|
14 |
|
---|
15 | concurrency:
|
---|
16 | group: "build"
|
---|
17 | cancel-in-progress: true
|
---|
18 |
|
---|
19 | jobs:
|
---|
20 | build-win32:
|
---|
21 | name: "Build for Windows 32-bit"
|
---|
22 | runs-on: ubuntu-latest
|
---|
23 |
|
---|
24 | permissions:
|
---|
25 | contents: write
|
---|
26 |
|
---|
27 | steps:
|
---|
28 | - name: Checkout
|
---|
29 | uses: actions/checkout@v4
|
---|
30 | - name: Install packages
|
---|
31 | run: sudo apt-get install nsis mingw-w64
|
---|
32 | - name: Get OpenSSL
|
---|
33 | run: git clone https://github.com/clamwin/openssl
|
---|
34 | - name: Make it use the correct library
|
---|
35 | run: cp openssl/lib/mingw/x86/*.a openssl/lib/
|
---|
36 | - name: Build
|
---|
37 | run: ./installer.sh win32
|
---|
38 | - name: Rename
|
---|
39 | run: mv install-nossl.exe tewiinst32-nossl.exe && mv install-ssl.exe tewiinst32-ssl.exe
|
---|
40 | - name: Create a zipfile
|
---|
41 | run: zip -rv tewiinst32.zip tewiinst32-*.exe
|
---|
42 | - name: Upload artifact
|
---|
43 | uses: actions/upload-artifact@v4
|
---|
44 | with:
|
---|
45 | name: build-win32
|
---|
46 | path: tewiinst32.zip
|
---|
47 |
|
---|
48 | build-win64:
|
---|
49 | name: "Build for Windows 64-bit"
|
---|
50 | runs-on: ubuntu-latest
|
---|
51 |
|
---|
52 | permissions:
|
---|
53 | contents: write
|
---|
54 |
|
---|
55 | steps:
|
---|
56 | - name: Checkout
|
---|
57 | uses: actions/checkout@v4
|
---|
58 | - name: Install packages
|
---|
59 | run: sudo apt-get install nsis mingw-w64
|
---|
60 | - name: Get OpenSSL
|
---|
61 | run: git clone https://github.com/clamwin/openssl
|
---|
62 | - name: Make it use the correct library
|
---|
63 | run: cp openssl/lib/mingw/x64/*.a openssl/lib/
|
---|
64 | - name: Build
|
---|
65 | run: ./installer.sh win64
|
---|
66 | - name: Rename
|
---|
67 | run: mv install-nossl.exe tewiinst64-nossl.exe && mv install-ssl.exe tewiinst64-ssl.exe
|
---|
68 | - name: Create a zipfile
|
---|
69 | run: zip -rv tewiinst64.zip tewiinst64-*.exe
|
---|
70 | - name: Upload artifact
|
---|
71 | uses: actions/upload-artifact@v4
|
---|
72 | with:
|
---|
73 | name: build-win64
|
---|
74 | path: tewiinst64.zip
|
---|
75 |
|
---|
76 | release:
|
---|
77 | name: "Release"
|
---|
78 | runs-on: ubuntu-latest
|
---|
79 | if: ${{ contains(github.event.head_commit.message, '[forcerebuild]') || contains(github.event.head_commit.message, '[release') || github.event.inputs.release }}
|
---|
80 |
|
---|
81 | permissions:
|
---|
82 | contents: write
|
---|
83 |
|
---|
84 | needs: [build-win32, build-win64]
|
---|
85 |
|
---|
86 | steps:
|
---|
87 | - name: Checkout
|
---|
88 | uses: actions/checkout@v4
|
---|
89 | - name: Download from build-win32
|
---|
90 | uses: actions/download-artifact@v4
|
---|
91 | with:
|
---|
92 | name: build-win32
|
---|
93 | - name: Download from build-win64
|
---|
94 | uses: actions/download-artifact@v4
|
---|
95 | with:
|
---|
96 | name: build-win64
|
---|
97 | - name: Extract
|
---|
98 | run: unzip tewiinst32.zip && unzip tewiinst64.zip
|
---|
99 | - name: Delete old release
|
---|
100 | run: gh release delete "$(make get-version)" --cleanup-tag -y || true
|
---|
101 | env:
|
---|
102 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
---|
103 | - name: Release
|
---|
104 | run: gh release create -t "v$(make get-version)" "$(make get-version)" tewiinst32*.exe tewiinst64*.exe -n "Version \`$(make get-version)\` was build in this release"
|
---|
105 | env:
|
---|
106 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
---|