-
Notifications
You must be signed in to change notification settings - Fork 10
154 lines (130 loc) · 4.39 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
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
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: [ "beta" ]
# 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
outputs:
name: ${{ steps.exe-name.outputs.EXENAME }}
defaults:
run:
shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'
steps:
- name: Set up Cygwin
uses: egor-tensin/setup-cygwin@v4
with:
packages: make gcc-g++ zlib-devel
- name: Set git to use LF
shell: pwsh
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: Get current time
id: time1
uses: Kaven-Universe/github-action-current-date-time@v1
with:
format: "YYYYMMDD-HHmmss"
timezone-offset: -480
- uses: benjlevesque/[email protected]
id: short-sha
with:
length: 6
- name: Generate artifact name
id: exe-name
run: |
echo "$GITHUB_OUTPUT"
echo "EXENAME=$EXENAME" >> "$GITHUB_OUTPUT"
env:
EXENAME: paotin-for-windows-setup-${{ steps.time1.outputs.time }}-B${{ github.run_number }}-g${{ steps.short-sha.outputs.sha }}.exe
- name: Install PCRE
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 --enable-unicode-properties --prefix=$(pwd)/usr LDFLAGS=-static && make && make install)
- name: Compile
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++
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
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 installer
uses: joncloud/makensis-action@v4
with:
script-file: install.nsi
arguments: "/V3"
- name: Rename installer
run: |
cd $(cygpath $GITHUB_WORKSPACE)
mv setup.exe ${{ steps.exe-name.outputs.EXENAME }}
- name: Create artifact -- PaoTin++ Installer
uses: actions/upload-artifact@v3
with:
name: ${{ steps.exe-name.outputs.EXENAME }}
path: ${{ steps.exe-name.outputs.EXENAME }}
- name: Create artifact -- WinTin++
uses: actions/upload-artifact@v3
with:
name: WinTin++
path: |
${{ github.workspace }}/bin/tt++.exe
${{ github.workspace }}/bin/cygwin1.dll
- 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
publish:
runs-on: ubuntu-latest
needs: build
steps:
- name: Retrieve artifact files
uses: actions/download-artifact@v3
with:
name: ${{ needs.build.outputs.name }}
- name: Send to file server
uses: appleboy/[email protected]
with:
host: ${{ secrets.FILE_SERVER_HOST }}
port: ${{ secrets.FILE_SERVER_PORT }}
username: ${{ secrets.FILE_SERVER_USER }}
key: ${{ secrets.FILE_SERVER_KEY }}
source: ${{ needs.build.outputs.name }}
target: ${{ secrets.FILE_SERVER_ROOT }}/Windows/