-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (45 loc) · 1.38 KB
/
c.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
name: C build and release
on:
push:
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Set up MSVC for 32-bit compilation
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86 # specify 32-bit architecture
- name: Compile the C code for Windows XP
run: cl.exe /D_WIN32_WINNT=0x0501 /Fe:program.exe main.c /link /SUBSYSTEM:WINDOWS,5.01
- name: Upload the executable as an artifact
uses: actions/upload-artifact@v2
with:
name: program
path: program.exe
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: program
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: release-${{ github.sha }}
release_name: Release ${{ github.run_number }}
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./program.exe
asset_name: program.exe
asset_content_type: application/octet-stream