-
-
Notifications
You must be signed in to change notification settings - Fork 119
96 lines (77 loc) · 3.12 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
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
name: Release OpenFFBoard firmware
# Controls when the workflow will run
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
# Branch filtering is not possible when triggerd by tags!
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Build_firmware:
uses: ./.github/workflows/build-firmware.yml
Build_configurator:
name: Build configurator
# The type of runner that the job will run on
runs-on: ${{ matrix.conf.os }}
strategy:
fail-fast: false
matrix:
conf: [ {os: 'windows-latest', pyver: '3.8'},{os: 'windows-latest', pyver: '3.11'}, {os: 'macos-latest', pyver: '3.10'}]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: Build configurator
id: build_c
uses: ./Configurator/.github/actions/build-pyinstaller
with:
path: '${{ github.workspace }}/Configurator'
python-version: '${{ matrix.conf.pyver }}'
- uses: actions/upload-artifact@v3
with:
name: OpenFFBoard-Configurator-${{ matrix.conf.os }}-py${{ matrix.conf.pyver }}
path: ${{ steps.build_c.outputs.distpath }}
Release:
needs: [Build_firmware,Build_configurator] # Requires build first
name: Create release
runs-on: ubuntu-latest
#if: github.event.base_ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
# Download artifacts for release
- uses: actions/download-artifact@v3
with:
path: etc/usr/artifacts/
- name: Copy firmware readme
run: cp -u ${{ github.workspace }}/Firmware/Targets/README_FIRMWARE.md etc/usr/artifacts/README.md
# # Move hex files
# - name: Move firmware files
# run: find etc/usr/artifacts/ -name '*.hex' -exec cp {} etc/usr/fw/ \;
- name: Zip firmware
run: zip -qq -r Firmware.zip OpenFFBoard-Firmware-* README.md
working-directory: etc/usr/artifacts/
- name: Zip configurator
run: |
for i in OpenFFBoard-Configurator-*/; do zip -qq -r "${i%/}.zip" "$i"; done
working-directory: etc/usr/artifacts/
- name: Make changelog
run: |
echo -e "### Firmware changes\n" > /tmp/CHANGELOG.md
cat ${{ github.workspace }}/CHANGELOG.md >> /tmp/CHANGELOG.md
echo -e "\n### Configurator changes\n" >> /tmp/CHANGELOG.md
cat ${{ github.workspace }}/Configurator/CHANGELOG.md >> /tmp/CHANGELOG.md
# Create release
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
name: "OpenFFBoard ${{github.ref_name}}"
body_path: /tmp/CHANGELOG.md
files: etc/usr/artifacts/*.zip
prerelease: ${{contains(github.ref_name, '-')}}