-
Notifications
You must be signed in to change notification settings - Fork 1
106 lines (91 loc) · 2.74 KB
/
release.yaml
File metadata and controls
106 lines (91 loc) · 2.74 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
name: Release
#on:
# push:
# tags:
# - '*'
on:
workflow_dispatch:
inputs:
prerelease:
type: boolean
description: Is this a prerelease?
required: true
default: true
dest_github_release:
type: boolean
description: Publish to GitHub release?
required: false
default: true
dest_pypi:
type: boolean
description: Publish to PyPI (Test PyPI if prerelease)?
required: false
default: true
env:
PYTHON_VERSION: '3.10'
BUILD_COMPONENT_OPENGL: 'true'
BUILD_COMPONENT_DOCUMENTATION: 'false'
BUILD_COMPONENT_PYTHON_PLUGIN: 'false'
ARTIFACT_NAME: 'packages'
ARTIFACT_DOWNLOAD_PATH: '_packages'
jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
- os: macos-12
- os: windows-2019
runs-on: ${{ matrix.os }}
continue-on-error: false
steps:
# NOTE checkout to ensure actions can be found
- name: Checkout repository
uses: actions/checkout@v4
- name: Build packages
id: packaging
uses: ./.github/actions/packaging
with:
python_version: ${{ env.PYTHON_VERSION }}
build_component_opengl: ${{ env.BUILD_COMPONENT_OPENGL }}
build_component_python_plugin: ${{ env.BUILD_COMPONENT_PYTHON_PLUGIN }}
build_component_doc: ${{ env.BUILD_COMPONENT_DOCUMENTATION }}
build_options: |
--wheel
- name: Archive built packages
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ steps.packaging.outputs.build_dir }}/*
if-no-files-found: error
- name: Test built packages
uses: ./.github/actions/testing
with:
python_version: ${{ env.PYTHON_VERSION }}
build_dir: ${{ steps.packaging.outputs.build_dir }}
publish:
needs: [ build-and-test ]
runs-on: ubuntu-latest
continue-on-error: false
permissions:
contents: write # NOTE for github release
id-token: write # NOTE for trusted publishing
steps:
# NOTE checkout to ensure actions can be found
- name: Checkout repository
uses: actions/checkout@v4
- name: Download archived built packages
id: downloading
uses: actions/download-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.ARTIFACT_DOWNLOAD_PATH }}
- name: Publish packages
uses: ./.github/actions/publishing
with:
prerelease: ${{ inputs.prerelease }}
build_dir: ${{ steps.downloading.outputs.download-path }}
dest_github_release: ${{ inputs.dest_github_release }}
dest_pypi_test: ${{ inputs.dest_pypi }}
dest_pypi: ${{ inputs.dest_pypi }}