Skip to content

Commit 15dce55

Browse files
authored
Merge pull request #5 from matyalatte/dev
Dev
2 parents 7b9c56f + 5c468e4 commit 15dce55

34 files changed

+481
-269
lines changed

.github/workflows/build_all.yml

+38-50
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ on:
55

66
env:
77
ZIP_NAME: SimpleCommandRunner
8-
WX_VERSION: 3.1.5
98

109
jobs:
1110
setup:
1211
runs-on: ubuntu-latest
1312
outputs:
1413
version: ${{ steps.check-tag.outputs.version }}
1514
url: ${{ steps.create-release.outputs.upload_url }}
15+
wx_version: ${{ steps.wx-version.outputs.version }}
1616
steps:
1717

1818
- name: Check tag
@@ -25,6 +25,15 @@ jobs:
2525
fi
2626
echo "::set-output name=version::$VERSION"
2727
shell: bash
28+
29+
- uses: actions/checkout@v2
30+
31+
- name: Check wxWidget version
32+
id: wx-version
33+
run: |
34+
VERSION=$(cat WX_VERSION.txt)
35+
echo "::set-output name=version::$VERSION"
36+
shell: bash
2837

2938
- name: Create Release Draft
3039
id: create-release
@@ -47,51 +56,37 @@ jobs:
4756
steps:
4857
- uses: actions/checkout@v2
4958

50-
- name: Setup msbuild
51-
uses: microsoft/setup-msbuild@v1.1
52-
5359
- name: Cache wxWidget
5460
uses: actions/cache@v2
5561
id: cache-wx
5662
with:
57-
path: "C:/wxWidgets-${{ env.WX_VERSION }}"
58-
key: ${{ runner.os }}-wx${{ env.WX_VERSION }}
63+
path: "C:/wxWidgets-${{ needs.setup.outputs.wx_version }}"
64+
key: ${{ runner.os }}-wx${{ needs.setup.outputs.wx_version }}
5965

60-
- name: download wxWidget
66+
- name: Setup nmake
6167
if: steps.cache-wx.outputs.cache-hit != 'true'
62-
run: |
63-
cd C:/
64-
curl -OL https://github.com/wxWidgets/wxWidgets/releases/download/v${{ env.WX_VERSION }}/wxWidgets-${{ env.WX_VERSION }}.zip
65-
unzip -d wxWidgets-${{ env.WX_VERSION }} wxWidgets-${{ env.WX_VERSION }}.zip
66-
shell: bash
68+
uses: ilammy/msvc-dev-cmd@v1
6769

68-
- name: build wxWidget
70+
- name: install wxWidget
6971
if: steps.cache-wx.outputs.cache-hit != 'true'
7072
run: |
71-
cd C:/wxWidgets-${{ env.WX_VERSION }}
72-
mkdir release
73-
cd release
74-
cmake -G "Visual Studio 17 2022" -A x64 -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=install -D wxBUILD_SHARED=OFF ../
75-
msbuild INSTALL.vcxproj /t:build /p:configuration=Release /p:platform=x64 -maxcpucount
76-
del C:/wxWidgets-${{ env.WX_VERSION }}.zip
77-
78-
- name: copy wx to git repo
79-
run: |
80-
mkdir 3rdparty
81-
cp -r C:/wxWidgets-${{ env.WX_VERSION }}/release/install 3rdparty/wxWidgets-${{ env.WX_VERSION }}
82-
73+
cd batch_files
74+
./download_wxWidgets.bat
75+
./build_wxWidgets.bat
76+
77+
- name: Setup msbuild
78+
uses: microsoft/setup-msbuild@v1.1
79+
8380
- name: build exe
8481
run: |
85-
mkdir build
86-
cd build
87-
cmake -G "Visual Studio 17 2022" -A x64 -D CMAKE_BUILD_TYPE=Release -D CMAKE_BUILD_SHARED=OFF ../
88-
msbuild SimpleCommandRunner.vcxproj /t:build /p:configuration=Release /p:platform=x64 -maxcpucount
82+
cd batch_files
83+
./build_exe.bat
8984
9085
- name: copy files
9186
run: |
9287
mkdir -p ../release
9388
cp build/Release/SimpleCommandRunner.exe ../release
94-
cp samples/advanced/gui_definition.json ../release
89+
cp samples/5_advanced/gui_definition.json ../release
9590
cp changelog.txt ../release
9691
cp license.txt ../release
9792
shell: bash
@@ -115,7 +110,7 @@ jobs:
115110
asset_name: ${{ env.ZIP_NAME }}${{ needs.setup.outputs.version }}-${{ runner.os }}.zip
116111
asset_content_type: application/zip
117112

118-
build_ubuntu_and_mac:
113+
build_unix:
119114
strategy:
120115
matrix:
121116
os: [ubuntu-20.04, macos-10.15]
@@ -128,48 +123,41 @@ jobs:
128123
uses: actions/cache@v2
129124
id: cache-wx
130125
with:
131-
path: "~/wxWidgets-${{ env.WX_VERSION }}"
132-
key: ${{ runner.os }}-wx${{ env.WX_VERSION }}-
126+
path: "~/wxWidgets-${{ needs.setup.outputs.wx_version }}"
127+
key: ${{ runner.os }}-wx${{ needs.setup.outputs.wx_version }}
133128

134129
- name: install gtk
135-
if: runner.os=="Linux"
130+
if: runner.os=='Linux'
136131
run: |
137132
sudo apt -y install libgtk-3-dev
138133
139134
- name: build wxWidget
140135
if: steps.cache-wx.outputs.cache-hit != 'true'
141136
run: |
142-
cd ~/
143-
wget https://github.com/wxWidgets/wxWidgets/releases/download/v${{ env.WX_VERSION }}/wxWidgets-${{ env.WX_VERSION }}.tar.bz2
144-
tar -xvjof wxWidgets-${{ env.WX_VERSION }}.tar.bz2
145-
cd wxWidgets-${{ env.WX_VERSION }}
146-
mkdir release
147-
cd release
148-
../configure --enable-monolithic --disable-shared
149-
make -j$(nproc)
137+
cd shell_scripts
138+
download_wxWidget.sh
139+
build_wxWidget.sh
150140
151141
- name: install wxWidget
152142
run: |
153-
cd ~/wxWidgets-${{ env.WX_VERSION }}/release
154-
sudo make install
143+
cd shell_scripts
144+
install_wxWidget.sh
155145
156146
- name: build exe
157147
run: |
158-
ls
159-
mkdir build
160-
cd build
161-
cmake -DCMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=OFF ../
162-
cmake --build .
148+
cd shell_scripts
149+
build_exe.sh
163150
164151
- name: copy files
165152
run: |
166153
mkdir -p ../release/${{ env.ZIP_NAME }}
167154
cp build/SimpleCommandRunner ../release/${{ env.ZIP_NAME }}
168-
cp samples/advanced/gui_definition.json ../release/${{ env.ZIP_NAME }}
155+
cp samples/5_advanced/gui_definition.json ../release/${{ env.ZIP_NAME }}
169156
cp changelog.txt ../release/${{ env.ZIP_NAME }}
170157
cp license.txt ../release/${{ env.ZIP_NAME }}
171158
cd ../release
172159
tar -jcvf ${{ env.ZIP_NAME }}.tar.bz2 ${{ env.ZIP_NAME }}
160+
173161
- name: Upload Release Asset for ubuntu
174162
id: upload-release-asset-ubuntu
175163
uses: actions/upload-release-asset@v1

.github/workflows/build_mac.yml

+33-20
Original file line numberDiff line numberDiff line change
@@ -5,64 +5,77 @@ on:
55

66
env:
77
ZIP_NAME: SimpleCommandRunner
8-
WX_VERSION: 3.1.5
98

109
jobs:
1110
build:
1211
runs-on: macos-10.15
1312
steps:
1413

1514
- uses: actions/checkout@v2
15+
16+
- name: Check wxWidget version
17+
id: wx-version
18+
run: |
19+
VERSION=$(cat WX_VERSION.txt)
20+
echo "::set-output name=version::$VERSION"
21+
shell: bash
1622

1723
- name: Cache wxWidget
1824
uses: actions/cache@v2
1925
id: cache-wx
2026
with:
21-
path: "~/wxWidgets-${{ env.WX_VERSION }}"
22-
key: ${{ runner.os }}-wx${{ env.WX_VERSION }}
27+
path: "~/wxWidgets-${{ steps.wx-version.outputs.version }}"
28+
key: ${{ runner.os }}-wx${{ steps.wx-version.outputs.version }}
2329

2430
- name: build wxWidget
2531
if: steps.cache-wx.outputs.cache-hit != 'true'
2632
run: |
27-
cd ~/
28-
wget https://github.com/wxWidgets/wxWidgets/releases/download/v${{ env.WX_VERSION }}/wxWidgets-${{ env.WX_VERSION }}.tar.bz2
29-
tar -xvjof wxWidgets-${{ env.WX_VERSION }}.tar.bz2
30-
cd wxWidgets-${{ env.WX_VERSION }}
31-
mkdir release
32-
cd release
33-
../configure --enable-monolithic --disable-shared
34-
make -j$(nproc)
33+
cd shell_scripts
34+
download_wxWidget.sh
35+
build_wxWidget.sh
3536
3637
- name: install wxWidget
3738
run: |
38-
cd ~/wxWidgets-${{ env.WX_VERSION }}/release
39-
sudo make install
39+
cd shell_scripts
40+
install_wxWidget.sh
4041
4142
- name: build exe
4243
run: |
43-
ls
44-
mkdir build
45-
cd build
46-
cmake -DCMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=OFF ../
47-
cmake --build .
44+
cd shell_scripts
45+
build_exe.sh
4846
4947
- name: copy files
5048
run: |
5149
mkdir -p ../release/${{ env.ZIP_NAME }}
5250
cp build/SimpleCommandRunner ../release/${{ env.ZIP_NAME }}
53-
cp samples/advanced/gui_definition.json ../release/${{ env.ZIP_NAME }}
51+
cp samples/5_advanced/gui_definition.json ../release/${{ env.ZIP_NAME }}
5452
cp changelog.txt ../release/${{ env.ZIP_NAME }}
5553
cp license.txt ../release/${{ env.ZIP_NAME }}
5654
cd ../release
5755
tar -jcvf ${{ env.ZIP_NAME }}.tar.bz2 ${{ env.ZIP_NAME }}
5856
57+
- name: Create Release Draft
58+
id: create_release
59+
uses: actions/create-release@v1
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
with:
63+
tag_name: ${{ github.ref }}
64+
release_name: ${{ github.ref }}
65+
body: |
66+
Changelog
67+
- First Change
68+
- Second Change
69+
draft: true
70+
prerelease: false
71+
5972
- name: Upload Release Asset for ubuntu
6073
id: upload-release-asset-ubuntu
6174
uses: actions/upload-release-asset@v1
6275
env:
6376
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6477
with:
65-
upload_url: ${{ needs.setup.outputs.url }}
78+
upload_url: ${{ steps.create_release.outputs.upload_url }}
6679
asset_path: ../release/${{ env.ZIP_NAME }}.tar.bz2
6780
asset_name: ${{ env.ZIP_NAME }}-${{ runner.os }}.tar.bz2
6881
asset_content_type: application/zip

.github/workflows/build_ubuntu.yml

+33-20
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,27 @@ on:
55

66
env:
77
ZIP_NAME: SimpleCommandRunner
8-
WX_VERSION: 3.1.5
98

109
jobs:
1110
build:
1211
runs-on: ubuntu-20.04
1312
steps:
1413

1514
- uses: actions/checkout@v2
15+
16+
- name: Check wxWidget version
17+
id: wx-version
18+
run: |
19+
VERSION=$(cat WX_VERSION.txt)
20+
echo "::set-output name=version::$VERSION"
21+
shell: bash
1622

1723
- name: Cache wxWidget
1824
uses: actions/cache@v2
1925
id: cache-wx
2026
with:
21-
path: "~/wxWidgets-${{ env.WX_VERSION }}"
22-
key: ${{ runner.os }}-wx${{ env.WX_VERSION }}
27+
path: "~/wxWidgets-${{ steps.wx-version.outputs.version }}"
28+
key: ${{ runner.os }}-wx${{ steps.wx-version.outputs.version }}
2329

2430
- name: install gtk
2531
run: |
@@ -28,45 +34,52 @@ jobs:
2834
- name: build wxWidget
2935
if: steps.cache-wx.outputs.cache-hit != 'true'
3036
run: |
31-
cd ~/
32-
wget https://github.com/wxWidgets/wxWidgets/releases/download/v${{ env.WX_VERSION }}/wxWidgets-${{ env.WX_VERSION }}.tar.bz2
33-
tar -xvjof wxWidgets-${{ env.WX_VERSION }}.tar.bz2
34-
cd wxWidgets-${{ env.WX_VERSION }}
35-
mkdir release
36-
cd release
37-
../configure --enable-monolithic --disable-shared
38-
make -j$(nproc)
37+
cd shell_scripts
38+
download_wxWidget.sh
39+
build_wxWidget.sh
3940
4041
- name: install wxWidget
4142
run: |
42-
cd ~/wxWidgets-${{ env.WX_VERSION }}/release
43-
sudo make install
43+
cd shell_scripts
44+
install_wxWidget.sh
4445
4546
- name: build exe
4647
run: |
47-
ls
48-
mkdir build
49-
cd build
50-
cmake -DCMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=OFF ../
51-
cmake --build .
48+
cd shell_scripts
49+
build_exe.sh
5250
5351
- name: copy files
5452
run: |
5553
mkdir -p ../release/${{ env.ZIP_NAME }}
5654
cp build/SimpleCommandRunner ../release/${{ env.ZIP_NAME }}
57-
cp samples/advanced/gui_definition.json ../release/${{ env.ZIP_NAME }}
55+
cp samples/5_advanced/gui_definition.json ../release/${{ env.ZIP_NAME }}
5856
cp changelog.txt ../release/${{ env.ZIP_NAME }}
5957
cp license.txt ../release/${{ env.ZIP_NAME }}
6058
cd ../release
6159
tar -jcvf ${{ env.ZIP_NAME }}.tar.bz2 ${{ env.ZIP_NAME }}
60+
61+
- name: Create Release Draft
62+
id: create_release
63+
uses: actions/create-release@v1
64+
env:
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+
with:
67+
tag_name: ${{ github.ref }}
68+
release_name: ${{ github.ref }}
69+
body: |
70+
Changelog
71+
- First Change
72+
- Second Change
73+
draft: true
74+
prerelease: false
6275

6376
- name: Upload Release Asset for ubuntu
6477
id: upload-release-asset-ubuntu
6578
uses: actions/upload-release-asset@v1
6679
env:
6780
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6881
with:
69-
upload_url: ${{ needs.setup.outputs.url }}
82+
upload_url: ${{ steps.create_release.outputs.upload_url }}
7083
asset_path: ../release/${{ env.ZIP_NAME }}.tar.bz2
7184
asset_name: ${{ env.ZIP_NAME }}-${{ runner.os }}.tar.bz2
7285
asset_content_type: application/zip

0 commit comments

Comments
 (0)