-
Notifications
You must be signed in to change notification settings - Fork 1
92 lines (70 loc) · 2.42 KB
/
release.yml
File metadata and controls
92 lines (70 loc) · 2.42 KB
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
---
name: "Pre-Release"
on:
push:
branches: [ "main" ]
paths:
- '.github/workflows/release.yml'
pull_request:
branches: [ "main" ]
paths:
- 'cpp/**'
- '.github/workflows/release.yml'
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Archive artifact
uses: actions/upload-artifact@v3
with:
name: linux-binary
path: ${{github.workspace}}/build/cpp/libserialport.so
build_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Archive artifact
uses: actions/upload-artifact@v3
with:
name: windows-binary
path: ${{github.workspace}}\build\cpp\Release\serialport.dll
pre-release:
needs: [build_windows, build_linux]
name: "Pre Release"
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: ${{github.workspace}}/tmp
- name: Rename linux Binary
run: mv ${{github.workspace}}/tmp/linux-binary/libserialport.so ${{github.workspace}}/ts/bin/linux.so
- name: Rename windows Binary
run: mv ${{github.workspace}}/tmp/windows-binary/serialport.dll ${{github.workspace}}/ts/bin/windows.dll
- run: cd ${{github.workspace}}
- name: make .tar.gz file
run: tar -czvf SerialLink-lib.tar.gz ./ts
- name: make .zip
run: zip -r SerialLink-lib.zip ./ts
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.RELEASE_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Development Build"
files: |
SerialLink-lib.tar.gz
SerialLink-lib.zip