Skip to content

Commit 3bb94e8

Browse files
authored
add continuous integration to build a release on windows (#4)
1 parent 516cb78 commit 3bb94e8

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

.github/workflows/build.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: mineflow-ci
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build_window_x64:
10+
runs-on: windows-latest
11+
12+
steps:
13+
- name: Checkout Actions Repository
14+
uses: actions/checkout@v3
15+
with:
16+
submodules: "recursive"
17+
18+
- name: Add msbuild to PATH
19+
uses: microsoft/setup-msbuild@v1.1
20+
21+
- name: Prepare build directory
22+
run: |
23+
mkdir $env:GITHUB_WORKSPACE/build
24+
cd $env:GITHUB_WORKSPACE/build
25+
cmake -A x64 ..
26+
27+
- name: Build app for release
28+
run: |
29+
cd $env:GITHUB_WORKSPACE/build
30+
msbuild ALL_BUILD.vcxproj /p:Configuration=Release
31+
32+
- name: Zip binary
33+
if: success()
34+
run: |
35+
mkdir $env:GITHUB_WORKSPACE/release
36+
cd $env:GITHUB_WORKSPACE/release
37+
38+
cp $env:GITHUB_WORKSPACE/build/bin/Release/mineflow.exe .
39+
cp $env:GITHUB_WORKSPACE/README.md .
40+
41+
Compress-Archive -Path ./* -DestinationPath $env:GITHUB_WORKSPACE/mineflow-windows-x86_64.zip
42+
43+
- name: Collect artifacts
44+
if: success()
45+
uses: actions/upload-artifact@v3
46+
with:
47+
name: mineflow-windows-x86_64
48+
path: mineflow-windows-x86_64.zip
49+
50+
release:
51+
needs:
52+
- build_window_x64
53+
54+
runs-on: ubuntu-latest
55+
permissions:
56+
contents: write
57+
58+
steps:
59+
- name: Download artifacts
60+
uses: actions/download-artifact@v3
61+
62+
- name: Show directory structure
63+
run: |
64+
ls -R
65+
66+
- name: Upload artifacts
67+
uses: ncipollo/release-action@v1
68+
with:
69+
commit: main
70+
artifacts: "mineflow-windows-x86_64/mineflow-windows-x86_64.zip"

0 commit comments

Comments
 (0)