-
Notifications
You must be signed in to change notification settings - Fork 23
64 lines (57 loc) · 2.11 KB
/
release.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
name: C++ CI Workflow with apt dependencies for release
on:
push:
branches:
- master
pull_request:
release:
types: [published]
schedule:
# * is a special character in YAML so you have to quote this string
# Execute a "nightly" build at 2 AM UTC
- cron: '0 2 * * *'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
build_type: [Release]
os: [ubuntu-20.04]
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Dependencies
run: |
sudo apt-get install cmake build-essential rename
- name: Create packages
run: |
mkdir -p build
cd build
cmake -DYCM_MAINTAINER_MODE:BOOL=ON -DCPACK_BINARY_TGZ:BOOL=ON -DCPACK_BINARY_DEB:BOOL=ON -DCPACK_DEBIAN_PACKAGE_DEPENDS="cmake" \
-DCPACK_DEBIAN_PACKAGE_NAME="ycm-cmake-modules" -DCPACK_DEBIAN_PACKAGE_MAINTAINER="Silvio Traversaro" ..
make
make package
rename 's/YCM/ycm-cmake-modules/' YCM-*-all.deb
rename 's/YCM/ycm-cmake-modules/' YCM-*-all.tar.gz
export YCM_VERSION=`ls ycm-cmake-modules-*-all.deb | cut -d - -f 4`
echo "YCM_VERSION=$YCM_VERSION" >> ${GITHUB_ENV}
- name: Upload .deb package
if: github.event_name == 'release'
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: build/ycm-cmake-modules-${{ env.YCM_VERSION }}-all.deb
asset_name: ycm-cmake-modules-${{ env.YCM_VERSION }}-all.deb
asset_content_type: application/octet-stream
- name: Upload .tar.gz package
if: github.event_name == 'release'
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: build/ycm-cmake-modules-${{ env.YCM_VERSION }}-all.tar.gz
asset_name: ycm-cmake-modules-${{ env.YCM_VERSION }}-all.tar.gz
asset_content_type: application/octet-stream