Skip to content

Commit 454642c

Browse files
authored
Merge pull request #80 from OpenSEMBA/automate-ubuntu-release
Create automate ubuntu release
2 parents 8d93cac + a4a15d5 commit 454642c

1 file changed

Lines changed: 121 additions & 0 deletions

File tree

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: "Ubuntu-automated-releases"
2+
3+
permissions:
4+
actions: write
5+
contents: write
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
- automate-ubuntu-release
12+
13+
env:
14+
TULIP_TOP_DIR: tulip
15+
MFEM_TOP_DIR: mfem
16+
17+
18+
jobs:
19+
builds-and-tests:
20+
strategy:
21+
matrix:
22+
os: [ubuntu-latest]
23+
target: [opt]
24+
25+
name: ${{ matrix.os }}-${{ matrix.target }}
26+
27+
runs-on: ${{ matrix.os }}
28+
timeout-minutes: 240
29+
30+
steps:
31+
- name: Cancel Previous Runs
32+
uses: styfle/cancel-workflow-action@0.11.0
33+
with:
34+
access_token: ${{ github.token }}
35+
36+
- name: checkout TULIP
37+
uses: actions/checkout@v4
38+
with:
39+
path: ${{ env.TULIP_TOP_DIR }}
40+
ssh-key: ${{secrets.PULMTLN_SSH_KEY}}
41+
submodules: 'recursive'
42+
43+
- name: getcmake
44+
uses: lukka/get-cmake@latest
45+
46+
- name: Install system packages
47+
run: bash ${{ env.TULIP_TOP_DIR }}/scripts/install-packages.sh
48+
49+
- name: Setup vcpkg
50+
uses: lukka/run-vcpkg@v11
51+
with:
52+
vcpkgGitCommitId: eed289f6e06a5e7a5c9e6a729671b0a56af7dd69
53+
vcpkgJsonGlob: 'tulip/vcpkg.json'
54+
55+
- name: cache MFEM
56+
uses: actions/cache@v3
57+
id: mfem-cache
58+
with:
59+
path: ${{ env.MFEM_TOP_DIR }}
60+
key: mfem-build-ubuntu-opt
61+
62+
- name: checkout MFEM
63+
if: steps.mfem-cache.outputs.cache-hit != 'true'
64+
uses: actions/checkout@v4
65+
with:
66+
repository: opensemba/mfem
67+
path: ${{ env.MFEM_TOP_DIR }}
68+
69+
- name: build MFEM
70+
if: steps.mfem-cache.outputs.cache-hit != 'true'
71+
uses: mfem/github-actions/build-mfem@v2.4
72+
env:
73+
HYPRE_TOP_DIR: hypre-2.19.0
74+
METIS_TOP_DIR: metis-4.0.3
75+
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/vcpkg_cache
76+
with:
77+
os: ubuntu-latest
78+
target: opt
79+
mpi: seq
80+
build-system: cmake
81+
hypre-dir: ${{ env.HYPRE_TOP_DIR }}
82+
metis-dir: ${{ env.METIS_TOP_DIR }}
83+
mfem-dir: ${{ env.MFEM_TOP_DIR }}
84+
85+
- name: Configuring TULIP
86+
env:
87+
MFEM_PACKAGE: ${{ github.workspace }}/${{env.MFEM_TOP_DIR}}/build
88+
run: |
89+
cmake --preset "gnu" -S tulip -B tulip/build
90+
91+
- name: Building TULIP
92+
run: |
93+
cmake --build tulip/build --parallel 2
94+
95+
- name: test TULIP
96+
run: cd tulip && ctest --test-dir ./build --output-on-failure
97+
98+
- name: Get current date
99+
id: date
100+
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
101+
102+
- name: Create dist folder
103+
shell: bash
104+
run: |
105+
mkdir -p tulip/dist/bin tulip/dist/lib
106+
cp -r tulip/build/bin/* tulip/dist/bin/ || true
107+
cp -r tulip/build/lib/* tulip/dist/lib/ || true
108+
109+
- name: Create .tar file
110+
run: |
111+
cd tulip && tar -czvf tulip-ubuntu.tar.gz dist/*
112+
113+
- name: Generating release
114+
uses: "marvinpinto/action-automatic-releases@latest"
115+
with:
116+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
117+
automatic_release_tag: "latest-ubuntu-tulip"
118+
prerelease: false
119+
title: "${{ steps.date.outputs.date }} Ubuntu TULIP"
120+
files: |
121+
tulip/tulip-ubuntu.tar.gz

0 commit comments

Comments
 (0)