-
Notifications
You must be signed in to change notification settings - Fork 10
121 lines (108 loc) · 4.1 KB
/
bundle_with_dakota_caller.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
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
name: 🏎️ Make & Test Wheels 🏎️
env:
ERT_SHOW_BACKTRACE: 1
NO_PROJECT_RES: 1
BOOST_VERSION: 1.85.0
DAKOTA_VERSION: 6.19.0
INSTALL_DIR: local
NEEDS_REBUILD: true
on:
pull_request:
push:
branches:
- main
tags: "v*"
workflow_dispatch:
inputs:
publish:
type: boolean
default: false
jobs:
build-settings:
runs-on: ubuntu-latest
outputs: # We define the globals here (reason: passing global env variables to wf inputs does not work)
ERT_SHOW_BACKTRACE: ${{ env.ERT_SHOW_BACKTRACE }}
NO_PROJECT_RES: ${{ env.NO_PROJECT_RES }}
BOOST_VERSION: ${{ env.BOOST_VERSION }}
DAKOTA_VERSION: ${{ env.DAKOTA_VERSION }}
INSTALL_DIR: ${{ env.INSTALL_DIR }}
NEEDS_REBUILD: ${{ env.NEEDS_REBUILD }}
steps:
- uses: actions/cache@v4
name: Check cache for already built wheels
id: cache-package
with:
key: carolina_wheels_boost${{ env.BOOST_VERSION }}_dakota${{ env.DAKOTA_VERSION }}
path: /tmp/dist
- name: Write cache status to outputs
if: steps.cache-package.outputs.cache-hit == 'true'
run:
echo "NEEDS_REBUILD=false" >> $GITHUB_OUTPUT
build_macos_wheels:
needs: build-settings
if: ${{ needs.build-settings.outputs.NEEDS_REBUILD == 'true' }}
uses: ./.github/workflows/bundle_with_dakota_macos.yml
with:
ERT_SHOW_BACKTRACE: ${{ needs.build-settings.outputs.ERT_SHOW_BACKTRACE}}
NO_PROJECT_RES: ${{ needs.build-settings.outputs.NO_PROJECT_RES}}
BOOST_VERSION: ${{ needs.build-settings.outputs.BOOST_VERSION}}
DAKOTA_VERSION: ${{ needs.build-settings.outputs.DAKOTA_VERSION}}
INSTALL_DIR: ${{ needs.build-settings.outputs.INSTALL_DIR}}
secrets: inherit
build_linux_wheels:
if: ${{ needs.build-settings.outputs.NEEDS_REBUILD == 'true' }}
needs: build-settings
uses: ./.github/workflows/bundle_with_dakota_linux.yml
with:
ERT_SHOW_BACKTRACE: ${{ needs.build-settings.outputs.ERT_SHOW_BACKTRACE}}
NO_PROJECT_RES: ${{ needs.build-settings.outputs.NO_PROJECT_RES}}
BOOST_VERSION: ${{ needs.build-settings.outputs.BOOST_VERSION}}
DAKOTA_VERSION: ${{ needs.build-settings.outputs.DAKOTA_VERSION}}
INSTALL_DIR: ${{ needs.build-settings.outputs.INSTALL_DIR}}
secrets: inherit
publish_wheels:
needs: [ build-settings, build_macos_wheels, build_linux_wheels ]
runs-on: ubuntu-latest
steps:
- name: "Download built artifacts"
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create dist/ folder with all the wheels
run: |
mkdir dist
find artifacts -type f -name "carolina*.whl" -exec mv {} dist/ \;
ls dist
- name: Cache wheels folder
if: steps.cache-package.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: dist
key: carolina_wheels_boost${{ needs.build-settings.outputs.BOOST_VERSION }}_dakota${{ needs.build-settings.outputs.DAKOTA_VERSION }}
- uses: actions/cache/restore@v4
id: restore-cached-package
with:
key: carolina_wheels_boost${{ needs.build-settings.outputs.BOOST_VERSION }}_dakota${{ needs.build-settings.outputs.DAKOTA_VERSION }}
path: dist
- name: Validate dist with twine check
run: |
ls dist
pip install twine
twine check dist/*
# remove carolina dev-wheels if any
echo "Looking for dev-wheels: matching on carolina*dev*.whl"
if [ -n "$(find dist . -name 'carolina*dev*.whl' -print -quit)" ]; then
echo "Removing dev-wheels.."
rm dist/carolina*dev*.whl
fi
ls dist
- name: Publish to pypi
uses: pypa/[email protected]
if: >
(github.event_name == 'workflow_dispatch' && inputs.publish) ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags'))
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
packages-dir: dist/
skip-existing: true