-
Notifications
You must be signed in to change notification settings - Fork 25
104 lines (85 loc) · 2.83 KB
/
compilation.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: CI-compile
on:
push:
pull_request:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v3
- name: Install Ubuntu version
if: ${{ matrix.os == 'ubuntu-latest' && always() }}
run: make --trace RELEASE=yes
- name: Install Mac version
if: ${{ matrix.os == 'macos-latest' && always() }}
run: make --debug USE_THREADED_IIN=no IIN_OPTICAL_MMAP=no RELEASE=yes
- name: Get short SHA
id: slug
run: echo "SHA=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_ENV
- name: Create tar archive (keep executable bit)
run: tar -zcvf hdl-dump-${{ env.SHA }}-${{matrix.os}}.tar.gz hdl_dump
- uses: actions/upload-artifact@v3
with:
name: hdl-dump-${{ env.SHA }}-${{matrix.os}}
path: |
*tar.gz
build-win:
runs-on: ubuntu-latest
container: dockcross/windows-static-x86:latest
steps:
- uses: actions/checkout@v3
- name: Compile windows version with cross-compilator
run: |
make --trace XC=win RELEASE=yes
mkdir -p rel
mv hdl_dump.exe rel/
make clean
make --trace -C gui XC=win RELEASE=yes
mv gui/hdl_dumb.exe rel/
- name: Get short SHA
id: slug
run: echo "SHA=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_ENV
- name: Create tar archive
run: tar -zcvf hdl-dump-${{ env.SHA }}-windows-latest.tar.gz rel
- uses: actions/upload-artifact@v3
with:
name: hdl-dump-${{ env.SHA }}-windows-latest
path: |
*tar.gz
release:
needs: [build, build-win]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
- name: Get short SHA
id: slug
run: echo "SHA=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_ENV
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Create pre-release
if: github.ref == 'refs/heads/master'
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: true
automatic_release_tag: "latest"
title: "Development build"
files: |
hdl-dump-${{ env.SHA }}-windows-latest/*
hdl-dump-${{ env.SHA }}-ubuntu-latest/*
hdl-dump-${{ env.SHA }}-macos-latest/*
- name: Create Tagged Release Draft
if: startsWith(github.ref, 'refs/tags/v')
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
draft: true
files: |
hdl-dump-${{ env.SHA }}-windows-latest/*
hdl-dump-${{ env.SHA }}-ubuntu-latest/*
hdl-dump-${{ env.SHA }}-macos-latest/*