-
Notifications
You must be signed in to change notification settings - Fork 1
114 lines (106 loc) · 3.35 KB
/
ci.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: New CI flow for Climb OBC Software
on:
push:
branches: [ develop ]
paths-ignore:
- '.github/**'
release:
types: [created]
workflow_dispatch:
jobs:
prepBuild:
runs-on: ubuntu-latest
name: Prepare Build Variables
outputs:
obcVersion: ${{ steps.create_ver.outputs.THE_SWVERSION }}
obcVersion2: ${{ steps.create_ver.outputs.MY_SWVERSION }}
steps:
- id: create_ver
name: Set Variables
run: |
THE_SWVERSION=$(printf '%.8s' "${{ github.sha }}" )
MY_SWVERSION=$(printf '%.10s' "$GITHUB_REF_NAME" )
#echo "THE_SWVERSION=$THE_SWVERSION" >> $GITHUB_ENV
#echo "MY_SWVERSION=$MY_SWVERSION" >> $GITHUB_ENV
echo "THE_SWVERSION=$THE_SWVERSION" >> "$GITHUB_OUTPUT"
echo "MY_SWVERSION=$MY_SWVERSION" >> "$GITHUB_OUTPUT"
echo "jobs output obcVersion set to '$THE_SWVERSION'"
echo "jobs output obcVersion2 set to '$MY_SWVERSION''"
buildDoc:
runs-on: ubuntu-latest
needs: prepBuild
name: Build the Documentation
steps:
- env:
OBC_VERSION: ${{needs.prepBuild.outputs.obcVersion2}}
name: simulate pdf creation
run: |
echo "$OBC_VERSION"
echo dummy build creating pdf ...
echo "dummy content for pdf" >> ./ClimbObcManual.pdf
pwd
ls
- name: Upload Document
uses: actions/upload-artifact@v3
id: upload-axf
with:
name: 'BuildResult'
path: ./ClimbObcManual.pdf
#path: ${{ steps.publish-document.outputs.pdf }}
if-no-files-found: error
buildIt:
runs-on: ubuntu-latest
needs: prepBuild
name: Build the Software artefacts
strategy:
matrix:
kind: ['obc', 'dev']
include:
- kind: obc
board: BA_CLIMBOBC
- kind: dev
board: BA_OM13085_EM2T
steps:
- env:
OBC_VERSION: ${{needs.prepBuild.outputs.obcVersion2}}
name: simulate build
run: |
echo "$OBC_VERSION"
echo dummy build creating result ...
echo "dummy content for ${{ matrix.kind }}"
echo "dummy content for ${{ matrix.kind }}" >> ./ClimbObc${{ env.OBC_VERSION }}-${{ matrix.kind }}.axf
pwd
ls
- name: Upload Binary
env:
MY_SWVERSION: ${{needs.prepBuild.outputs.obcVersion2}}
uses: actions/upload-artifact@v3
id: upload-axf
with:
name: 'BuildResult'
path: ClimbObc${{ env.MY_SWVERSION }}-${{ matrix.kind }}.axf
if-no-files-found: error
releaseJob:
if: github.event_name == 'release' && github.event.action == 'created'
runs-on: ubuntu-latest
needs: [ buildIt, buildDoc ]
steps:
- name: Download all the build files
uses: actions/download-artifact@v3
with:
name: 'BuildBuildResult'
path: ./
- name: show path
run: |
ls
zip artefacts.zip *.*
ls
- name: upload reelese assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: artefacts.zip
asset_name: archive_zip
asset_content_type: application/zip