-
Notifications
You must be signed in to change notification settings - Fork 4
116 lines (100 loc) · 3.34 KB
/
packagebuild.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
105
106
107
108
109
110
111
112
113
114
115
116
name: package build
on:
push:
tags:
- 'v*'
- 'RC*'
jobs:
build-targets-job:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Setup cmake
uses: jwlawson/[email protected]
with:
github-api-token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout Repository
uses: actions/checkout@v2
with:
submodules: true # Fetch athrill repo
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Checkout toppers utils
run: git clone https://github.com/mitsut/toppers_utils.git
- name: Build athrill for Linux or Mac
if: " (matrix.os == 'ubuntu-latest') || (matrix.os == 'macos-latest') "
run: |
mkdir build
cd build
cmake -H..
make
./athrill2
- name: Setup MinGW for Windows
if: matrix.os == 'windows-latest'
uses: egor-tensin/setup-mingw@v2
- name: Build athrill for Windows
if: matrix.os == 'windows-latest'
run: |
mkdir build_win
mkdir build
cd build
cmake -G"MinGW Makefiles" ..
make
.\athrill2.exe
- name: Move to build folder(linux)
if: matrix.os == 'ubuntu-latest'
run: |
cp build/athrill2 build_linux/
perl toppers_utils/makerelease E_PACKAGE
- name: Move to build folder(mac)
if: matrix.os == 'macos-latest'
run: |
cp build/athrill2 build_mac/
perl toppers_utils/makerelease E_PACKAGE.darwin
- name: Move to build folder(win)
if: matrix.os == 'windows-latest'
run: |
cp build/athrill2.exe build_win/
perl toppers_utils/makerelease E_PACKAGE.win
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: athrill-targets
path: RELEASE/*.tar.gz
MakeRelease:
runs-on: ubuntu-latest
needs: [build-targets-job]
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- name: Get commit summary
id: get_commit_summary
run: |
PREVIOUS_TAG=$(git tag --sort=-creatordate | sed -n 2p)
echo "PREVIOUS_TAG: $PREVIOUS_TAG"
COMMIT_SUMMARY="$(git log --oneline --pretty=tformat:"%h %s" $PREVIOUS_TAG..${{ github.ref }})"
COMMIT_SUMMARY="${COMMIT_SUMMARY//$'\n'/'%0A'}"
echo ::set-output name=COMMIT_SUMMARY::$COMMIT_SUMMARY
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Display structure of downloaded files
run: ls -R
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
name: Release ${{ steps.get_version.outputs.VERSION }}
body: |
${{ steps.get_commit_summary.outputs.COMMIT_SUMMARY }}
draft: true
prerelease: true
files: |
./athrill-targets/*.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}