-
Notifications
You must be signed in to change notification settings - Fork 45
143 lines (137 loc) · 5 KB
/
release.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: Create release
on:
push:
tags:
- '*'
permissions:
contents: read
jobs:
build:
name: Build libraries
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
optional_args: -pt
- os: windows-latest
optional_args: -pt --cmake_gen ninja
- os: macos-latest
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Config environment
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install gcc-multilib
- name: Setup Fortran compiler
uses: fortran-lang/setup-fortran@8821f57b53846d35d62632eb51c60ac6c4bff4ce # v1.6.1
with:
compiler: intel
- name: Build C library
run: python buildall.py -ft ${{ matrix.optional_args }}
- name: Display structure of files
run: ls -R
- name: Upload artifact
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: build-artifacts-${{ matrix.os }}
path: |
build*/**/bin
build*/**/fortran
# build wheels only for cpython versions 3.8-3.12 on linux and windows 64-bits
python_build:
name: Build ittapi wheels
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
cibw_skip_args: "*_i686 *-musllinux_* cp313-*"
- os: windows-latest
cibw_skip_args: "*-win32 *_i686 cp313-*"
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install cibuildwheels
run: python -m pip install cibuildwheel==2.20.0
- name: Build ittapi python wheels
run: python -m cibuildwheel python --output-dir python_dist
env:
CIBW_BUILD: cp3*
CIBW_SKIP: ${{ matrix.cibw_skip_args }}
- name: Upload artifact
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: build-artifacts-python-${{ matrix.os }}
path: python_dist*/**
create_release:
permissions:
contents: write # for actions/create-release to create a release
id-token: write # for actions/attest-build-provenance to attest provenance
attestations: write # for actions/attest-build-provenance to attest provenance
name: Create release
runs-on: ubuntu-latest
needs: [build, python_build]
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Create release
id: create_release
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: release ${{ github.ref_name }}
draft: false
prerelease: false
- name: Download artifacts
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
with:
path: build-artifacts
pattern: build-artifacts-*
merge-multiple: true
- name: Display structure of downloaded files
run: ls -R
- name: Zip files
run: |
zip -r ittapi_build_${{ github.ref_name }}.zip include &&
cd build-artifacts &&
zip -rg ../ittapi_build_${{ github.ref_name }}.zip build*/**/bin build*/**/fortran python_dist &&
cd -
- name: Generate release provenance
uses: actions/attest-build-provenance@1c608d11d69870c2092266b3f9a6f3abbf17002c # v1.4.3
with:
subject-path: ./ittapi_build_${{ github.ref_name }}.zip
- name: Upload release asset
id: upload-release-asset
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./ittapi_build_${{ github.ref_name }}.zip
asset_name: ittapi_build_${{ github.ref_name }}.zip
asset_content_type: application/zip
# upload the built wheels to PyPi
upload_to_pypi:
name: Upload the wheel files to PyPi
runs-on: ubuntu-latest
needs: [python_build, create_release]
steps:
- name: Download artifacts
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
with:
pattern: build-artifacts-*
merge-multiple: true
- name: List wheel files
run: find -name *.whl
- name: Publish package distributions to PyPi
uses: pypa/gh-action-pypi-publish@0ab0b79471669eb3a4d647e625009c62f9f3b241 # v1.10.1
with:
password: ${{ secrets.PYPI }}
repository-url: https://upload.pypi.org/legacy/
packages-dir: python_dist
skip-existing: true