-
Notifications
You must be signed in to change notification settings - Fork 50
73 lines (70 loc) · 2.31 KB
/
release-builds.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
on:
push:
tags:
- v*
pull_request: # Build windows exe and docs, but not release anything
jobs:
windows-build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
# This should be the oldest python version we support, so it is
# backwards-compatible for older windows versions.
python-version: "3.9"
cache: pip
- run: pip install wheel
- run: pip install -r requirements-dev.txt
- uses: egor-tensin/setup-clang@v1
with:
platform: x64
# -u makes print show in real time
- run: python -u scripts/build-exe-installer.py
- uses: actions/upload-artifact@v4
with:
name: windows-exe
path: build/PorcupineSetup_*.exe
changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
# Extract second "## blah" separated part, excluding the "## blah" lines
# https://stackoverflow.com/a/20943815
awk '/^## / { part++ } (part == 1 && line++ != 0) { print }' CHANGELOG.md | tee changelog_part.md
- uses: actions/upload-artifact@v4
with:
name: changelog
path: changelog_part.md
release:
runs-on: ubuntu-latest
# https://stackoverflow.com/a/58478262
#needs: [windows-build, docs, changelog]
needs: [windows-build, changelog]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
with:
name: windows-exe
- uses: actions/download-artifact@v4
with:
name: changelog
- id: get_version
uses: battila7/get-version-action@v2
- id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body_path: changelog_part.md
- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: PorcupineSetup_${{ steps.get_version.outputs.version-without-v }}.exe
asset_name: PorcupineSetup_${{ steps.get_version.outputs.version-without-v }}.exe
asset_content_type: application/vnd.microsoft.portable-executable