-
Notifications
You must be signed in to change notification settings - Fork 44
190 lines (159 loc) · 5.55 KB
/
build.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
name: CI
on: [push, pull_request]
env:
BUILD_DIR: _build
XTB_VERSION: 6.5.0
jobs:
intel-meson-build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
fc: [ifort]
cc: [icc]
env:
FC: ${{ matrix.fc }}
CC: ${{ matrix.cc }}
APT_PACKAGES: >-
intel-oneapi-compiler-fortran-2023.1.0
intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2023.1.0
intel-oneapi-mkl-2023.1.0
intel-oneapi-mkl-devel-2023.1.0
# APT_PACKAGES: >-
# intel-oneapi-compiler-fortran
# intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
# intel-oneapi-mkl
# intel-oneapi-mkl-devel
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Add Intel repository
if: contains(matrix.os, 'ubuntu')
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
- name: Install Intel oneAPI compiler
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get install ${{ env.APT_PACKAGES }}
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV
- name: Install meson
run: pip3 install meson==1.2.0 ninja
- name: Git Sumbodules (including tblite patch)
run: |
git submodule update --init
cd subprojects/tblite
git apply ../packagefiles/tblite/tblite_patch.patch
cd ../../
- name: Configure meson build
run: meson setup ${{ env.BUILD_DIR }} --prefix=/
- name: Build project
run: ninja -C ${{ env.BUILD_DIR }}
- name: Install package
run: |
meson install -C ${{ env.BUILD_DIR }} --no-rebuild
tar cJvf crest-latest.tar.xz --directory=${{ env.BUILD_DIR }} crest
env:
DESTDIR: ${{ env.PWD }}/_dist
- name: Upload binary
if: github.event_name == 'push'
uses: actions/upload-artifact@v2
with:
name: crest-latest.tar.xz
path: crest-latest.tar.xz
- name: Add crest to path
run: |
echo ${{ env.PWD }}/_dist/bin >> $GITHUB_PATH
- name: Download xtb
uses: i3h/download-release-asset@v1
with:
owner: grimme-lab
repo: xtb
tag: v${{ env.XTB_VERSION }}
file: '/xtb-${{ env.XTB_VERSION }}-linux-x86_64\.tar\.xz/'
- name: Add xtb to path
run: |
tar xvf xtb-*.tar.xz
echo ${{ env.PWD }}/xtb-${{ env.XTB_VERSION }}/bin >> $GITHUB_PATH
# - name: Run example 0
# run: |
# bash run.sh
# working-directory: examples/expl-0
continuous-delivery:
if: github.event_name == 'push'
runs-on: ubuntu-latest
needs:
- intel-meson-build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_TAG: latest
OUTPUT_INTEL: crest-latest.tar.xz
steps:
- uses: actions/checkout@v2
- name: Install github-release
run: |
go install github.com/github-release/github-release@latest
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Set environment variables
run: |
echo "GITHUB_USER=$( echo ${{ github.repository }} | cut -d/ -f1 )" >> $GITHUB_ENV
echo "GITHUB_REPO=$( echo ${{ github.repository }} | cut -d/ -f2 )" >> $GITHUB_ENV
- name: Move/Create continuous tag
run: |
git tag --force ${{ env.RELEASE_TAG }} ${{ github.sha }}
git push --tags --force
- name: Get Time
run: echo "TIME=$(date -u '+%Y/%m/%d, %H:%M')" >> $GITHUB_ENV
- name: Check continuous release status
run: |
if ! github-release info -t ${{ env.RELEASE_TAG }} > /dev/null 2>&1; then
echo "RELEASE_COMMAND=release" >> $GITHUB_ENV
else
echo "RELEASE_COMMAND=edit" >> $GITHUB_ENV
fi
- name: Setup continuous release
run: >-
github-release ${{ env.RELEASE_COMMAND }}
--tag ${{ env.RELEASE_TAG }}
--name "Continous release version"
--description "$DESCRIPTION"
--pre-release
env:
DESCRIPTION: |
Created on ${{ env.TIME }} UTC by @${{ github.actor }} with commit ${{ github.sha }}.
This is an automated distribution of the latest CREST version.
This version is only minimally tested and may be unstable or even crash.
Use with caution!
https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
path: ${{ github.workspace }} # This will download all files
- name: Create SHA256 checksum
run: |
cd ${{ env.OUTPUT_INTEL }}
sha256sum ${{ env.OUTPUT_INTEL }} > sha256.txt
- name: Add crest-latest to release tag
run: >-
github-release upload
--tag ${{ env.RELEASE_TAG }}
--replace
--name ${{ env.OUTPUT_INTEL }}
--file ${{ env.OUTPUT_INTEL }}/${{ env.OUTPUT_INTEL }}
- name: Add SHA256 checksums to release tag
run: >-
github-release upload
--tag ${{ env.RELEASE_TAG }}
--replace
--name sha256.txt
--file ${{ env.OUTPUT_INTEL }}/sha256.txt