Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.txt -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 | |
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.txt -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 |