forked from vedderb/vesc_tool
-
Notifications
You must be signed in to change notification settings - Fork 1
141 lines (137 loc) · 4.58 KB
/
linux.yml
File metadata and controls
141 lines (137 loc) · 4.58 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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Linux
on:
# workflow_run:
# workflows: ["CreateRelease"]
# types:
# - completed
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
vt_ver:
description: "VESC Tool Version"
required: true
default: "master"
type: string
fw_ver:
description: "Firmware Version"
required: true
default: "master"
type: string
release_notes:
description: "Release Notes"
required: false
default: ""
type: string
prerelease:
description: "Release as Prerelease"
required: true
default: true
type: boolean
permissions:
contents: write
jobs:
notify:
runs-on: ${{ matrix.os }}
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
strategy:
fail-fast: false
max-parallel: 6
matrix:
qt: [5.15.2]
os: [ubuntu-22.04]
steps:
- name: Version2Ref
run: |
if [[ "${{ inputs.vt_ver }}" =~ ^([0-9]+)\.([0-9]+)$ ]]; then
echo "VT_REF=release_${BASH_REMATCH[1]}_${BASH_REMATCH[2]}" >> $GITHUB_ENV
elif [[ "${{ inputs.vt_ver }}" == "master" ]]; then
echo "VT_REF=master" >> $GITHUB_ENV
else
echo "VT_REF=${{ inputs.vt_ver }}" >> $GITHUB_ENV
fi
shell: bash
- name: Clone Repository
uses: actions/checkout@v4
with:
ref: ${{ env.VT_REF }}
fetch-depth: 0
fetch-tags: true
- name: Checkout Workflow Scripts
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
path: .workflow-src
- name: Setup
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
CUSTOM_RELEASE_NOTES: ${{ inputs.release_notes }}
id: GetVersion
run: |
VT_VERSION=$(grep -m1 VT_VERSION vesc_tool.pro | awk -F= '{ print $2 }' | sed 's/[ ",]//g')
echo "VERSION=${VT_VERSION}" >> $GITHUB_OUTPUT
echo "PACKAGE_VERSION=${VT_VERSION}" >> $GITHUB_ENV
export VT_VERSION
export PRERELEASE="${{ inputs.prerelease }}"
bash .workflow-src/.github/scripts/generate_release_notes.sh
- name: Install Qt (Linux)
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qt }}
setup-python: false
cache: 'true'
cache-key-prefix: 'install-qt-action'
- name: Create TMP Dir
id: mktemp
run: echo "FW_TMP_DIR=$(mktemp -d)" >> $GITHUB_ENV
shell: bash
- name: Download FW Artifact
uses: dawidd6/action-download-artifact@v3
with:
name: firmware-${{ inputs.fw_ver }}
path: ${{ env.FW_TMP_DIR }}
github_token: ${{secrets.GITHUB_TOKEN}}
repo: darwinbeing/bldc
workflow: firmware.yml
workflow_conclusion: success
search_artifacts: true
- name: Apply Patch
env:
VT_VER: ${{ inputs.vt_ver }}
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}
run: |
bash .workflow-src/.github/scripts/apply_patch.sh
shell: bash
- name: Configure And Compile
continue-on-error: true
run: |
mkdir -p res/firmwares
cp -rv ${{ env.FW_TMP_DIR }}/* res/firmwares/
./build_lin
# - name: Upload Artifact
# uses: actions/upload-artifact@v3
# with:
# name: VESC_Tool-lin.AppImage
# path: VESC_Tool-x86_64.AppImage
- name: Upload Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.GetVersion.outputs.VERSION }}
release_name: Release ${{ steps.GetVersion.outputs.VERSION }}
body: ${{ steps.GetVersion.outputs.RELEASE_NOTES }}
file: VESC_Tool-x86_64.AppImage
asset_name: VESC_Tool-lin.AppImage
overwrite: true
prerelease: ${{ inputs.prerelease }}
# - name: Upload Release
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# tag: ${{ steps.GetVersion.outputs.VERSION }}
# release_name: Release ${{ steps.GetVersion.outputs.VERSION }}
# body: ${{ steps.GetVersion.outputs.RELEASE_NOTES }}
# file: vesc_tool_platinum-lin.zip
# asset_name: VESC_Tool-lin.zip
# overwrite: true
# prerelease: ${{ inputs.prerelease }}
# target_commit: ${{ env.VT_REF }}