|
| 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 | +  |
| 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 |
0 commit comments