Skip to content

Commit 6269481

Browse files
committed
feat: releases
1 parent 3700e6a commit 6269481

File tree

3 files changed

+91
-3
lines changed

3 files changed

+91
-3
lines changed

.github/workflows/CD.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: CD
2+
3+
on:
4+
push:
5+
tags: '*'
6+
7+
jobs:
8+
build-lin:
9+
name: Linux Build
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
- name: Configure Makefile
15+
run: |
16+
echo "CFLAGS=-Wall -Werror" > config.mk
17+
echo "LDFLAGS=-lm -fsanitize=address" >> config.mk
18+
- name: Build
19+
run: make
20+
- name: Run
21+
run: chmod +x mdp && ./mdp
22+
- name: Upload Artifact
23+
uses: actions/upload-artifact@v4
24+
with:
25+
name: mdp-linux
26+
path: mdp
27+
if-no-files-found: error
28+
build-win:
29+
name: Windows Build
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
- name: Install Dependencies
35+
run: |
36+
sudo apt-get update
37+
sudo apt-get install -y gcc-mingw-w64
38+
- name: Configure Makefile
39+
run: |
40+
echo "CC=x86_64-w64-mingw32-gcc" > config.mk
41+
echo "CFLAGS=-Wall -Werror -D__USE_MINGW_ANSI_STDIO" >> config.mk
42+
echo "LDFLAGS=-lm" >> config.mk
43+
- name: Build
44+
run: make
45+
- name: Upload Artifact
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: mdp-windows
49+
path: mdp.exe
50+
if-no-files-found: error
51+
release:
52+
name: Release
53+
if: github.repository == 'p2sr/mdp'
54+
needs: [build-lin, build-win]
55+
runs-on: ubuntu-latest
56+
steps:
57+
- name: Get Release Version
58+
id: get_release
59+
run: echo ::set-output name=version::${GITHUB_REF:10}
60+
- name: Download Linux Build
61+
uses: actions/download-artifact@v4
62+
with:
63+
name: mdp-linux
64+
- name: Download Windows Build
65+
uses: actions/download-artifact@v4
66+
with:
67+
name: mdp-windows
68+
- name: Create Release
69+
uses: softprops/action-gh-release@v1
70+
with:
71+
body: |
72+
![CD](https://github.com/p2sr/mdp/workflows/CD/badge.svg)
73+
74+
**Installation**
75+
- Download:
76+
- [Windows](https://github.com/p2sr/mdp/releases/download/${{ steps.get_release.outputs.version }}/mdp.exe)
77+
- [Linux](https://github.com/p2sr/mdp/releases/download/${{ steps.get_release.outputs.version }}/mdp)
78+
- Run `chmod +x mdp`
79+
80+
---
81+
82+
**Changelog**
83+
TODO
84+
files: |
85+
mdp
86+
mdp.exe
87+
prerelease: false
88+
fail_on_unmatched_files: true

.github/workflows/CI.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@ on:
1616
- "src/**/*.h"
1717
workflow_dispatch:
1818

19-
permissions:
20-
contents: read
21-
2219
jobs:
2320
build-lin:
21+
name: Linux Build
2422
runs-on: ubuntu-latest
2523
steps:
2624
- name: Checkout
@@ -40,6 +38,7 @@ jobs:
4038
path: mdp
4139
if-no-files-found: error
4240
build-win:
41+
name: Windows Build
4342
runs-on: ubuntu-latest
4443
steps:
4544
- name: Checkout

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# mdp
22

33
[![CI](https://github.com/p2sr/mdp/workflows/CI/badge.svg)](https://github.com/p2sr/mdp/actions?query=workflow%3ACI+branch%3Amaster)
4+
[![CD](https://github.com/p2sr/mdp/workflows/CD/badge.svg)](https://github.com/p2sr/mdp/actions?query=workflow%3ACD+branch%3Amaster)
45

56
`mdp` is a very simple demo parser for Portal 2 demos which extracts information injected by [SAR].
67

0 commit comments

Comments
 (0)