Skip to content
This repository was archived by the owner on Jan 28, 2022. It is now read-only.

Commit 9d93bca

Browse files
authored
Merge pull request #6 from YIO-Remote/develop
Integration library refactoring and automated release preparations
2 parents 46da5d9 + e0db19f commit 9d93bca

22 files changed

+1136
-458
lines changed

.clang-format

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# YIO project style configuration
2+
#
3+
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
4+
5+
BasedOnStyle: Google
6+
7+
IndentWidth: 4
8+
ColumnLimit: 120
9+
10+
AccessModifierOffset: -3
11+
AlignConsecutiveDeclarations: true

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ assignees: ''
77

88
---
99

10-
Before you open an issue, please search on the [issue tracker](../) if a similar issue already exists or has been closed before.
10+
<!-- Before you open an issue, please search on the [issue tracker](../) if a similar issue already exists or has been closed before. -->
1111

1212
## Description
1313
<!--- A clear and concise description of what the bug is. -->
@@ -28,10 +28,10 @@ Steps to reproduce the behavior:
2828
## Your Environment
2929
<!--- Include as many relevant details about the environment you experienced the bug in -->
3030
* Version used:
31-
* Running on:
32-
- [ ] YIO Remote
33-
- [ ] Desktop
34-
- [ ] Standalone Raspberry Pi
31+
* Running on: <!-- Remove / add environment(s) -->
32+
- YIO Remote
33+
- Desktop
34+
- Standalone Raspberry Pi
3535
* Operating System and version if not running on YIO Remote:
3636

3737
## Additional context

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ assignees: ''
77

88
---
99

10-
Before you open an issue, please search on the [issue tracker](../) if a similar issue already exists or has been closed before.
10+
<!-- Before you open an issue, please search on the [issue tracker](../) if a similar issue already exists or has been closed before. -->
1111

1212
**Is your feature request related to a problem? Please describe.**
13-
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
13+
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
1414

1515
**Describe the solution you'd like**
16-
A clear and concise description of what you want to happen.
16+
<!-- A clear and concise description of what you want to happen. -->
1717

1818
**Describe alternatives you've considered**
19-
A clear and concise description of any alternative solutions or features you've considered.
19+
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
2020

2121
**Additional context**
22-
Add any other context or screenshots about the feature request here.
22+
<!-- Add any other context or screenshots about the feature request here. -->

.github/ISSUE_TEMPLATE/general-enhancement.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ assignees: ''
77

88
---
99

10-
Before you open an issue, please search on the [issue tracker](../) if a similar issue already exists or has been closed before.
10+
<!-- Before you open an issue, please search on the [issue tracker](../) if a similar issue already exists or has been closed before. -->
1111

1212
## Expected Behavior or Design
1313
<!--- Explain the difference from the current behavior -->

.github/workflows/build.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# GitHub Action to cross compile a YIO Remote Qt project for the YIO remote-os.
2+
# Uses the pre-built Buildroot SDK from remote-os in a custom GitHub action.
3+
# Creates a pre-release if pushed on master branch without a version tag.
4+
# Creates a release if pushed on master branch with a version tag.
5+
---
6+
name: "Cross Compile & Release"
7+
8+
on:
9+
push:
10+
pull_request:
11+
12+
env:
13+
APP_NAME: libopenweather
14+
PROJECT_NAME: integration.openweather
15+
16+
jobs:
17+
build:
18+
name: ${{ matrix.config.name }}
19+
runs-on: ubuntu-latest
20+
strategy:
21+
matrix:
22+
config:
23+
- {
24+
name: "RPi0 Release Build", artifact: "remote-release",
25+
qmake-args: "CONFIG+=release"
26+
}
27+
- {
28+
name: "RPi0 Debug Build", artifact: "remote-debug",
29+
qmake-args: "CONFIG+=debug CONFIG+=qml_debug"
30+
}
31+
32+
steps:
33+
- name: github env vars
34+
run: |
35+
echo "$GITHUB_REF"
36+
echo "$GITHUB_HEAD_REF"
37+
echo "$GITHUB_BASE_REF"
38+
39+
- name: Checkout ${{ env.PROJECT_NAME}}
40+
uses: actions/checkout@v2
41+
with:
42+
# History of 500 should be more than enough to calculate commit count since last release tag.
43+
fetch-depth: 500
44+
path: ${{ env.PROJECT_NAME}}
45+
46+
- name: Fetch all tags to determine version
47+
run: |
48+
cd ${{ env.PROJECT_NAME}}
49+
git fetch origin +refs/tags/*:refs/tags/*
50+
git describe --match "v[0-9]*" --tags HEAD --always
51+
52+
- name: Set build timestamp
53+
run: echo "::set-env name=TIMESTAMP::$(date +"%Y%m%d_%H%M%S")"
54+
55+
- name: Cross compile
56+
id: cross-compile
57+
uses: zehnm/yio-crosscompile-action@master
58+
with:
59+
project-name: ${{ env.PROJECT_NAME }}
60+
output-path: ${GITHUB_WORKSPACE}/binaries/app
61+
qmake-args: ${{ matrix.config.qmake-args }}
62+
63+
- name: Upload build artefacts
64+
uses: actions/upload-artifact@v1
65+
with:
66+
path: binaries
67+
name: ${{ env.APP_NAME }}-${{ matrix.config.artifact }}
68+
69+
release:
70+
name: Create Release
71+
if: github.ref == 'refs/heads/master' || contains(github.ref, 'tags/v')
72+
runs-on: ubuntu-latest
73+
needs: build
74+
75+
steps:
76+
- run: mkdir release debug
77+
- name: Download release artifact
78+
uses: actions/download-artifact@v1
79+
with:
80+
name: ${{ env.APP_NAME }}-remote-release
81+
path: ./release
82+
- name: Download debug artifact
83+
uses: actions/download-artifact@v1
84+
with:
85+
name: ${{ env.APP_NAME }}-remote-debug
86+
path: ./debug
87+
- name: Get artifact version
88+
run: |
89+
read -r APP_VERSION < release/version.txt
90+
echo "::set-env name=APP_VERSION::$APP_VERSION"
91+
echo "::set-env name=TIMESTAMP::$(date +"%Y%m%d_%H%M%S")"
92+
93+
- name: Create GitHub release archives
94+
run: |
95+
tar cvf ${{ env.APP_NAME }}-${{ env.APP_VERSION }}-${{ env.TIMESTAMP }}-remote-debug.tar -C debug .
96+
tar cvf ${{ env.APP_NAME }}-${{ env.APP_VERSION }}-${{ env.TIMESTAMP }}-remote-release.tar -C release .
97+
98+
- name: Create Pre-Release ${{ env.APP_VERSION }}
99+
uses: "marvinpinto/action-automatic-releases@latest"
100+
if: "!contains(github.ref, 'tags/v')"
101+
with:
102+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
103+
automatic_release_tag: "latest"
104+
prerelease: true
105+
title: "Development Build ${{ env.APP_VERSION }}"
106+
files: |
107+
*.tar
108+
109+
- name: Create Release ${{ env.APP_VERSION }}
110+
uses: "marvinpinto/action-automatic-releases@latest"
111+
if: "contains(github.ref, 'tags/v')"
112+
with:
113+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
114+
prerelease: false
115+
files: |
116+
*.tar

0 commit comments

Comments
 (0)