-
Notifications
You must be signed in to change notification settings - Fork 12
48 lines (46 loc) · 1.63 KB
/
build.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: build
on: [push, pull_request]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: DoozyX/[email protected]
with: {style: Google}
build:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
cc: [ gcc, clang ]
needs: check
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
- if: ${{ startswith(matrix.os, 'windows-') && matrix.cc == 'gcc'}}
run: make CC="${{matrix.cc}}" && mv vcd.exe vcd-${{matrix.os}}-${{matrix.cc}}.exe
- if: ${{ startswith(matrix.os, 'windows-') && matrix.cc == 'clang'}}
run: make CC="${{matrix.cc}}" && mv vcd vcd-${{matrix.os}}-${{matrix.cc}}.exe
- if: startswith(matrix.os, 'windows-') == false
run: make CC="${{matrix.cc}}" && mv vcd vcd-${{matrix.os}}-${{matrix.cc}}
- uses: actions/upload-artifact@v2
with:
path: vcd-${{matrix.os}}-${{matrix.cc}}*
release:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: build
runs-on: ubuntu-latest
steps:
- id: date
run: echo "::set-output name=yymmdd::$(date +%y%m%d)"
- uses: actions/checkout@v2
- uses: mathieudutour/[email protected]
with:
custom_tag: ${{ steps.date.outputs.yymmdd }}
tag_prefix: ''
github_token: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true # tag exist
- uses: actions/download-artifact@v2
- uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.date.outputs.yymmdd }}
files: artifact/*