Skip to content

Commit ccdcc6d

Browse files
James Courtier-DuttonJames Courtier-Dutton
authored andcommitted
Add .github/workflows/main.yml
This builds a windows version of ectool. Signed-off-by: James Courtier-Dutton <james@superbug.co.uk>
1 parent b5a0dbd commit ccdcc6d

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

.github/workflows/main.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Build Windows/x64
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
runs-on: windows-latest
14+
15+
steps:
16+
- name: Checkout Repository with Submodules
17+
uses: actions/checkout@v4
18+
with:
19+
submodules: recursive
20+
21+
- name: Create Build Directory
22+
run: mkdir _build
23+
24+
- name: Configure with CMake
25+
shell: pwsh
26+
run: |
27+
cd _build
28+
& cmake -A x64 -T ClangCL ..
29+
30+
- name: Build with CMake
31+
shell: pwsh
32+
run: |
33+
cd _build
34+
& cmake --build . --config RelWithDebInfo --parallel
35+
36+
- name: Upload Build Artifacts
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: ectool
40+
path: |
41+
_build/src/RelWithDebInfo/ectool.exe
42+
_build/src/RelWithDebInfo/ectool.pdb
43+
44+
- name: Create Release
45+
id: create_release
46+
uses: actions/create-release@v1
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
with:
50+
tag_name: ${{ github.ref_name }}
51+
release_name: Release ${{ github.ref_name }}
52+
draft: false
53+
prerelease: false
54+
55+
- name: Upload Release Asset
56+
id: upload-release-asset
57+
uses: actions/upload-release-asset@v1
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
with:
61+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
62+
asset_path: _build/src/RelWithDebInfo/ectool.exe
63+
asset_name: ectool-windows-amd64.zip
64+
asset_content_type: application/zip
65+
66+

0 commit comments

Comments
 (0)