-
Notifications
You must be signed in to change notification settings - Fork 15
156 lines (136 loc) · 5.39 KB
/
Copy pathcreate-draft-release.yml
File metadata and controls
156 lines (136 loc) · 5.39 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: Create Draft Release
on:
pull_request:
types: [closed]
branches:
- master
workflow_dispatch:
jobs:
create-draft-release:
runs-on: [self-hosted, Linux]
if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged == true && github.event.pull_request.head.ref == 'dev')
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get version from source
id: get_version
run: |
VERSION=$(grep src/ofxEmotiBitVersion.h -e "ofxEmotiBitVersion" | grep -o '"[^"]*"' | tr -d '"')
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "tag=v$VERSION" >> $GITHUB_OUTPUT
- name: Check release does not already exist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="${{ steps.get_version.outputs.tag }}"
if gh release view "$TAG" --repo "${{ github.repository }}" &>/dev/null; then
echo "ERROR: A release tagged '$TAG' already exists (draft, pre-release, or published)."
echo "Bump the version in src/ofxEmotiBitVersion.h before creating a new release."
exit 1
fi
echo "No existing release found for '$TAG'. Proceeding."
- name: Download Mac artifacts
uses: dawidd6/action-download-artifact@v6
with:
workflow: build-all-on-macos.yml
branch: dev
name: EmotiBitSoftware_v${{ steps.get_version.outputs.version }}-macOS
path: ./
skip_unpack: true
continue-on-error: true
- name: Download Windows artifacts
uses: dawidd6/action-download-artifact@v6
with:
workflow: build-all-on-win.yaml
branch: dev
name: EmotiBitSoftware_v${{ steps.get_version.outputs.version }}-Windows
path: ./
skip_unpack: true
continue-on-error: true
- name: Download macOS dependencies report
uses: dawidd6/action-download-artifact@v6
with:
workflow: build-all-on-macos.yml
branch: dev
name: dependencies-report-macos
path: ./
continue-on-error: true
- name: Download Windows dependencies report
uses: dawidd6/action-download-artifact@v6
with:
workflow: build-all-on-win.yaml
branch: dev
name: dependencies-report-windows
path: ./
continue-on-error: true
- name: Download Linux dependencies report
uses: dawidd6/action-download-artifact@v6
with:
workflow: linux-workflows.yaml
branch: dev
name: dependencies-report-linux
path: ./
continue-on-error: true
- name: Generate release notes
run: |
VERSION="${{ steps.get_version.outputs.version }}"
cat > release_notes.md << END_OF_NOTES
# New features and bug fixes
# Firmware Installed by FirmwareInstaller
EmotiBit firmware [vx.x.x](enter-url-here)
# PRs completed
# Installation
#### Windows
- Download the **EmotiBitSoftware_v${VERSION}-Windows.zip** linked below.
- Extract the zip file downloaded
- run the **.exe** installer file.
- If the **Windows Defender Smartscreen** pops up, click on **More info** and **Run anyway**
- The **EmotiBit Oscilloscope** and **EmotiBit DataParser** will be installed on your system.
- You can access the software from the **Start** menu under **EmotiBit** or from the desktop shortcut.
#### macOS
- Download **EmotiBitSoftware_v${VERSION}-macOS.zip**
- Extract the downloaded zip file.
- The extracted folder will contain **EmotiBit Oscilloscope** and **EmotiBit DataParser**.
- Right-click and select **Open** to run the executables
#### Linux
- Download the source code linked below. Follow the steps in the [ReadMe](https://github.com/EmotiBit/ofxEmotiBit#readme).
# Dependencies
See attached **dependencies-report.zip** for the full dependency report per platform.
END_OF_NOTES
- name: Zip dependency reports
run: |
zip dependencies-report.zip \
dependencies-report-macos.txt \
dependencies-report-windows.txt \
dependencies-report-linux.txt \
2>/dev/null || true
- name: Create config.txt
id: create-config
run: |
CONFIG_CONTENT=$(cat <<-END_OF_CONFIG
{
"WifiCredentials": [
{
"ssid": "YOUR_WIFI_NAME_GOES_HERE",
"password": "YOUR_WIFI_PASSWORD_GOES_HERE"
}
]
}
END_OF_CONFIG
)
echo "$CONFIG_CONTENT" > config.txt
echo "Config file created successfully"
- name: Create Draft Release
uses: softprops/action-gh-release@v1
with:
draft: true
tag_name: ${{ steps.get_version.outputs.tag }}
name: Draft Release ${{ steps.get_version.outputs.tag }}
body_path: release_notes.md
files: |
EmotiBitSoftware_v${{ steps.get_version.outputs.version }}-macOS.zip
EmotiBitSoftware_v${{ steps.get_version.outputs.version }}-Windows.zip
config.txt
dependencies-report.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}