forked from casadi/casadi
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (62 loc) · 2.29 KB
/
create_artifact.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
name: Create release asset
on: [workflow_dispatch]
env:
CASADI_VERSION: v3.6.3
ASSET_NAME: casadi_install
jobs:
create_release_asset:
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install gcc g++ gfortran ninja-build git cmake liblapack-dev pkg-config --install-recommends -y
- uses: actions/checkout@v4
with:
ref: ${{ env.CASADI_VERSION }}
- name: Build casadi
run: |
mkdir -p ${{ env.ASSET_NAME }}
mkdir build
cd build
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/${{ env.ASSET_NAME }}
cd ..
cmake --build build
cmake --install build
zip ${{ env.ASSET_NAME }}.zip ${{ env.ASSET_NAME }}
- name: Build casadi (static)
run: |
mkdir -p ${{ env.ASSET_NAME }}-static
mkdir build
cd build
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DENABLE_SHARED=OFF -DENABLE_STATIC=ON -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/${{ env.ASSET_NAME }}-static
cd ..
cmake --build build
cmake --install build
zip ${{ env.ASSET_NAME }}-static.zip ${{ env.ASSET_NAME }}-static
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.CASADI_VERSION }}
release_name: Casadi v${{ env.CASADI_VERSION }}
- name: Upload asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: create_release
asset_name: casadi_v${{ env.CASADI_VERSION }}
asset_content_type: application/zip
- name: Upload asset (static)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: create_release
asset_name: casadi_v${{ env.CASADI_VERSION }}-static.zip
asset_content_type: application/zip