11
11
12
12
env :
13
13
APP_NAME : YIO-integration.openhab
14
- APP_ARCHITECTURE : RPi0
15
14
PROJECT_NAME : integration.openhab
16
15
HASH_FILENAME : yio-integration-openhab.hash
17
16
23
22
matrix :
24
23
config :
25
24
- {
26
- name : " RPi0 Release Build" , artifact: "RPi0-release",
27
- qmake-args : " CONFIG+=release"
25
+ name : " remote-os v0.x Build" , artifact: "RPi0-release",
26
+ qmake-args : " CONFIG+=release" ,
27
+ build-image : " zehnm/yio-crosscompile-action:1.1.0"
28
28
}
29
-
29
+ - {
30
+ name : " remote-os v1.x Build" , artifact: "RPi0-Qt5.12.8",
31
+ qmake-args : " CONFIG+=release" ,
32
+ build-image : " zehnm/yio-crosscompile-action:2.0.0"
33
+ }
34
+
30
35
steps :
31
36
- name : Checkout ${{ env.PROJECT_NAME}}
32
37
uses : actions/checkout@v2
33
38
with :
34
39
# History of 500 should be more than enough to calculate commit count since last release tag.
35
40
fetch-depth : 500
41
+ # Check out into sub folder, we also need the integrations.library at the same level!
36
42
path : ${{ env.PROJECT_NAME}}
37
43
38
44
- name : Fetch all tags to determine version
45
+ # Used in cross compile step
39
46
run : |
40
47
cd ${{ env.PROJECT_NAME}}
41
48
git fetch origin +refs/tags/*:refs/tags/*
42
49
git describe --match "v[0-9]*" --tags HEAD --always
43
50
44
- - name : Set build timestamp
45
- run : echo "::set-env name=TIMESTAMP::$(date +"%Y%m%d_%H%M%S")"
46
-
51
+ # Unfortunately we can't use a dynamic Action as in "uses: ${{ matrix.config.build-image }}"
52
+ # - name: Cross compile
53
+ # id: cross-compile
54
+
55
+ # with:
56
+ # project-name: ${{ env.PROJECT_NAME }}
57
+ # output-path: ${GITHUB_WORKSPACE}/binaries/app
58
+ # qmake-args: ${{ matrix.config.qmake-args }}
59
+ #
60
+ # So let's do it manually :-( Maybe one day we'll get that feature from GitHub...
47
61
- name : Cross compile
48
- id : cross-compile
49
-
50
- with :
51
- project-name : ${{ env.PROJECT_NAME }}
52
- output-path : ${GITHUB_WORKSPACE}/binaries/app
53
- qmake-args : ${{ matrix.config.qmake-args }}
54
-
62
+ run : |
63
+ docker pull ${{ matrix.config.build-image }}
64
+ docker run --workdir /github/workspace --rm \
65
+ -e GITHUB_WORKSPACE=/github/workspace \
66
+ -v /home/runner/work/${{ env.PROJECT_NAME}}/${{ env.PROJECT_NAME}}:/github/workspace \
67
+ ${{ matrix.config.build-image }} ${{ env.PROJECT_NAME}} /github/workspace/binaries/app ${{ matrix.config.qmake-args }} https://github.com/YIO-Remote/integrations.library.git .
68
+
69
+ - name : Get artifact version
70
+ run : |
71
+ read -r APP_VERSION < binaries/version.txt
72
+ echo "::set-env name=APP_VERSION::$APP_VERSION"
73
+
55
74
- name : Upload build artefacts
56
- uses : actions/upload-artifact@v1
75
+ uses : actions/upload-artifact@v2
57
76
with :
58
77
path : binaries
59
- name : ${{ env.APP_NAME }}-${{ matrix.config.artifact }}
78
+ name : ${{ env.APP_NAME }}-v${{ env.APP_VERSION }}-${{ matrix.config.artifact }}
79
+ if-no-files-found : error
60
80
61
81
release :
62
82
name : Create Release
65
85
needs : build
66
86
67
87
steps :
68
- - run : mkdir release
69
- - name : Download release artifact
70
- uses : actions/download-artifact@v1
71
- with :
72
- name : ${{ env.APP_NAME }}-${{ env.APP_ARCHITECTURE }}-release
73
- path : ./release
88
+ - name : Download build artifacts
89
+ uses : actions/download-artifact@v2
74
90
75
- - name : Get artifact version
91
+ - name : Display structure of downloaded files
92
+ run : ls -R
93
+
94
+ - name : Get timestamp
76
95
run : |
77
- read -r APP_VERSION < release/version.txt
78
- echo "::set-env name=APP_VERSION::$APP_VERSION"
79
96
echo "::set-env name=TIMESTAMP::$(date +"%Y%m%d_%H%M%S")"
80
-
97
+
81
98
- name : Create GitHub development build archives
82
99
if : " !contains(github.ref, 'tags/v')"
83
100
run : |
84
- tar cvf ${{ env.APP_NAME }}-v${{ env.APP_VERSION }}-${{ env.TIMESTAMP }} -${{ env.APP_ARCHITECTURE }}-release .tar -C release .
101
+ for D in *; do if [ -d "${D}" ]; then tar cvf $D -${{ env.TIMESTAMP }}.tar -C $D .; fi; done;
85
102
for filename in *.tar; do echo "sha256 `sha256sum $filename`" >> ${{ env.HASH_FILENAME }}; done;
86
103
87
- - name : Create Pre-Release ${{ env.APP_VERSION }}
104
+ - name : Create Pre-Release
88
105
uses : " marvinpinto/action-automatic-releases@latest"
89
106
if : " !contains(github.ref, 'tags/v')"
90
107
with :
91
108
repo_token : " ${{ secrets.GITHUB_TOKEN }}"
92
109
automatic_release_tag : " latest"
93
110
prerelease : true
94
- title : " Development Build ${{ env.APP_VERSION }} "
111
+ title : " Development Build"
95
112
files : |
96
113
*.tar
97
114
${{ env.HASH_FILENAME }}
98
115
99
116
- name : Create GitHub release archives
100
117
if : " contains(github.ref, 'tags/v')"
101
118
run : |
102
- tar cvf ${{ env.APP_NAME }}-v${{ env.APP_VERSION }}-${{ env.APP_ARCHITECTURE }}-release .tar -C release .
119
+ for D in *; do if [ -d "${D}" ]; then tar cvf $D .tar -C $D .; fi; done;
103
120
for filename in *.tar; do echo "sha256 `sha256sum $filename`" >> ${{ env.HASH_FILENAME }}; done;
104
121
105
- - name : Create Release ${{ env.APP_VERSION }}
122
+ - name : Create Release
106
123
uses : " marvinpinto/action-automatic-releases@latest"
107
124
if : " contains(github.ref, 'tags/v')"
108
125
with :
109
126
repo_token : " ${{ secrets.GITHUB_TOKEN }}"
110
127
prerelease : false
111
128
files : |
112
- *.tar
113
- ${{ env.HASH_FILENAME }}
129
+ *.tar
130
+ ${{ env.HASH_FILENAME }}
131
+
0 commit comments