forked from casadi/casadi
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (43 loc) · 1.51 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
name: Release with artifact
on: [workflow_dispatch]
env:
CASADI_VERSION: 3.6.3
INSTALL_DIR: casadi_install
jobs:
release_with_artifact:
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 and zip
run: |
mkdir -p ${{ env.INSTALL_DIR }}
mkdir build
cd build
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/${{ env.INSTALL_DIR }}
cd ..
cmake --build build
cmake --install build
zip -r casadi_v${{ env.CASADI_VERSION }}.zip ${{ env.INSTALL_DIR }}
- 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: casadi_v${{ env.CASADI_VERSION }}.zip
asset_name: casadi_v${{ env.CASADI_VERSION }}.zip
asset_content_type: application/zip