-
Notifications
You must be signed in to change notification settings - Fork 10
129 lines (115 loc) · 4.55 KB
/
Copy pathbundle_with_dakota_caller.yml
File metadata and controls
129 lines (115 loc) · 4.55 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: 🏎️ Make & Test Wheels 🏎️
permissions:
contents: read
env:
ERT_SHOW_BACKTRACE: 1
NO_PROJECT_RES: 1
BOOST_VERSION: 1.87.0
DAKOTA_VERSION: 6.24.0
INSTALL_DIR: local
NEEDS_REBUILD: true
on:
pull_request:
push:
branches:
- main
tags: "v*"
workflow_dispatch:
inputs:
publish:
type: boolean
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
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@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
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@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
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@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: dist
key: carolina_wheels_boost${{ needs.build-settings.outputs.BOOST_VERSION }}_dakota${{ needs.build-settings.outputs.DAKOTA_VERSION }}
- uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
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 -U pip
pip install twine
pip install -U packaging
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/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
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