forked from starokurov/otus-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (53 loc) · 1.71 KB
/
release.yml
File metadata and controls
63 lines (53 loc) · 1.71 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
name: 'C++ CI'
on:
push:
branches:
- master
- feature/github_actions
jobs:
build:
runs-on: ubuntu-latest
container: ubuntu:22.04 # Используем конкретную версию Ubuntu
steps:
- name: Install Git
run: |
apt-get update
apt-get install -y git
- uses: actions/checkout@v2
with:
submodules: true
- name: Install dependencies
run: |
apt-get install -y build-essential cmake libssl-dev
- name: Configure CMake
run: |
cmake . -DPATCH_VERSION=${{ github.run_number }} -DUNITTEST=ON \
-DCMAKE_CXX_FLAGS="-static-libstdc++ -static-libgcc"
- name: Build project
run: cmake --build .
- name: Run tests
run: |
mkdir -p test
ctest -V --output-on-failure
- name: Create DEB package
run: cmake --build . --target package
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.run_number }}
release_name: Release ${{ github.run_number }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./helloworld-0.0.${{ github.run_number }}-Linux.deb
asset_name: helloworld-0.0.${{ github.run_number }}-Linux.deb
asset_content_type: application/vnd.debian.binary-package