Create release asset #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |