-
Notifications
You must be signed in to change notification settings - Fork 50
88 lines (84 loc) · 2.69 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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@v2
- uses: actions/setup-python@v4
with:
python-version: "3.8" # last version supporting windows 7
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@v2
with:
name: windows-exe
path: build/PorcupineSetup_*.exe
# TODO: enable docs again? don't know why broken
#docs:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-python@v4
# with:
# python-version: "3.11"
# cache: pip
# - run: pip install wheel
# - run: pip install -r requirements-dev.txt
# - run: python3 -m sphinx ./docs ./build
# - if: startsWith(github.ref, 'refs/tags/v')
# uses: JamesIves/[email protected]
# with:
# branch: gh-pages
# folder: build
changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- 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@v2
with:
name: changelog
path: changelog_part.md
release:
runs-on: ubuntu-latest
# https://stackoverflow.com/a/58478262
needs: [windows-build, docs, changelog]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v2
with:
name: windows-exe
- uses: actions/download-artifact@v2
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