-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (64 loc) · 2.18 KB
/
Copy pathrelease.yml
File metadata and controls
66 lines (64 loc) · 2.18 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
name: 'Build'
on:
push:
branches:
- master
- feature/github_actions
workflow_dispatch:
jobs:
build_ubuntu:
runs-on: ubuntu-latest
permissions: write-all
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- run: sudo apt-get update && sudo apt-get install cmake libgtest-dev -y
- run: cmake . -DPATCH_VERSION=${{ github.run_number }}
- run: cmake --build . --config Release
- run: cmake --build . --target package
- run: ctest
- 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 Ubuntu ${{ github.run_number }}
draft: false
prerelease: false
- name: Upload Release Asset Ubuntu
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
build_windows:
runs-on: windows-latest
needs: build_ubuntu
permissions: write-all
steps:
- uses: actions/checkout@v3
with:
submodules: true
- run: git clone https://github.com/google/googletest.git
- run: cmake . -DPATCH_VERSION=${{ github.run_number }}
- run: cmake --build . --config Release
- run: ctest
- name: Upload Release Asset Windows
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.build_ubuntu.outputs.upload_url }}
asset_path: ./Release/helloworld.exe
asset_name: helloworld-0.0.${{ github.run_number }}-Windows.exe
asset_content_type: application/octet-stream