-
Notifications
You must be signed in to change notification settings - Fork 10
101 lines (86 loc) · 3.01 KB
/
windows-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
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
name: Windows build and publish
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
on:
push:
branches: [ "chore/windows" ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
branches: [ "master" ]
env:
# Use docker.io for Docker Hub if empty
REGISTRY: docker.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: windows-2019
steps:
- name: Set up Cygwin
uses: egor-tensin/setup-cygwin@v4
with:
packages: make gcc-g++ zlib-devel
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Check out code
uses: actions/checkout@v1
with:
submodules: true
- name: Install PCRE
shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'
run: |
cd $(cygpath $GITHUB_WORKSPACE)
curl -sL https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.bz2/download | tar jxvf -
(cd pcre-8.45 && ./configure LDFLAGS=-static prefix=$(pwd)/usr && make && make install)
- name: Compile
shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'
env:
CFLAGS: -I../../pcre-8.45/usr/include
CPPFLAGS: -I../../pcre-8.45/usr/include
LDFLAGS: -static -L../../pcre-8.45/usr/lib
run: |
cd $(cygpath $GITHUB_WORKSPACE)
(cd tintin/src && ./configure && make && strip tt++ || cat config.log)
- name: Check TinTin++
shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'
run: |
cd $(cygpath $GITHUB_WORKSPACE)
ls -lh tintin/src/tt++
file tintin/src/tt++
ldd tintin/src/tt++
tintin/src/tt++ -V || true
- name: Packaging
shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'
run: |
cd $(cygpath $GITHUB_WORKSPACE)
cp tintin/src/tt++.exe bin/
cp /bin/cygwin1.dll bin/
rm -rf .git
rm -rf .github
rm -rf tintin
rm -rf pcre-8.45
- name: Create artifact -- WinTin++
uses: actions/upload-artifact@v3
with:
name: WinTin++
path: |
${{ github.workspace }}/bin/tt++.exe
${{ github.workspace }}/bin/cygwin1.dll
- name: Create artifact -- PaoTin++
uses: actions/upload-artifact@v3
with:
name: PaoTin++ for Windows
path: |
${{ github.workspace }}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ github.workspace }}/tintin/src/tt++.exe
${{ github.workspace }}/README.md