Skip to content

Commit

Permalink
A more elegant way to set the environment variables locally in the jo…
Browse files Browse the repository at this point in the history
…bs that need it
  • Loading branch information
vijaiaeroastro committed Jun 4, 2024
1 parent 974da82 commit 426244d
Showing 1 changed file with 38 additions and 24 deletions.
62 changes: 38 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
build-linux-ubi8-gcc12:
runs-on: ubuntu-20.04
needs: [set-lib3mf-version]
env:
LIB3MF_VERSION: ${{ needs.set-lib3mf-version.outputs.lib3mf-version }}
steps:
- run: sudo apt update
- run: sudo apt install -y uuid-dev
Expand Down Expand Up @@ -110,6 +112,8 @@ jobs:
build-macos:
runs-on: macos-latest
needs: [set-lib3mf-version]
env:
LIB3MF_VERSION: ${{ needs.set-lib3mf-version.outputs.lib3mf-version }}
steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -186,6 +190,8 @@ jobs:
build-windows-release:
runs-on: windows-2019
needs: [set-lib3mf-version]
env:
LIB3MF_VERSION: ${{ needs.set-lib3mf-version.outputs.lib3mf-version }}
steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -283,6 +289,8 @@ jobs:
assemble-sdk:
runs-on: ubuntu-20.04
needs: [set-lib3mf-version, build-windows-release, build-macos, build-linux-ubi8-gcc12]
env:
LIB3MF_VERSION: ${{ needs.set-lib3mf-version.outputs.lib3mf-version }}
steps:
- run: sudo apt install -y zip unzip
- run: mkdir build
Expand All @@ -305,33 +313,35 @@ jobs:
- name: Archive SDK artifact (CPack - Linux)
uses: actions/upload-artifact@v2
with:
name: lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Linux.zip
path: build/lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Linux.zip
name: lib3mf-${{ env.LIB3MF_VERSION }}-Linux.zip
path: build/lib3mf-${{ env.LIB3MF_VERSION }}-Linux.zip
- name: Archive SDK artifact (CPack - Windows)
uses: actions/upload-artifact@v2
with:
name: lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Windows.zip
path: build/lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Windows.zip
name: lib3mf-${{ env.LIB3MF_VERSION }}-Windows.zip
path: build/lib3mf-${{ env.LIB3MF_VERSION }}-Windows.zip
- name: Archive SDK artifact (CPack - Darwin)
uses: actions/upload-artifact@v2
with:
name: lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Darwin.zip
path: build/lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Darwin.zip
name: lib3mf-${{ env.LIB3MF_VERSION }}-Darwin.zip
path: build/lib3mf-${{ env.LIB3MF_VERSION }}-Darwin.zip
- name: Archive SDK artifact (CPack - Debian)
uses: actions/upload-artifact@v2
with:
name: lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Linux.deb
path: build/lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Linux.deb
name: lib3mf-${{ env.LIB3MF_VERSION }}-Linux.deb
path: build/lib3mf-${{ env.LIB3MF_VERSION }}-Linux.deb
- name: Archive SDK artifact (CPack - RPM)
uses: actions/upload-artifact@v2
with:
name: lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Linux.rpm
path: build/lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Linux.rpm
name: lib3mf-${{ env.LIB3MF_VERSION }}-Linux.rpm
path: build/lib3mf-${{ env.LIB3MF_VERSION }}-Linux.rpm


deploy-linux:
runs-on: ubuntu-20.04
needs: [set-lib3mf-version, assemble-sdk]
env:
LIB3MF_VERSION: ${{ needs.set-lib3mf-version.outputs.lib3mf-version }}
steps:
- run: sudo apt install -y zip unzip file
- run: pwd
Expand Down Expand Up @@ -368,11 +378,11 @@ jobs:
- name: Download lib3mf cpack (Linux)
uses: actions/download-artifact@v2
with:
name: lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Linux.zip
path: lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Linux.zip
name: lib3mf-${{ env.LIB3MF_VERSION }}-Linux.zip
path: lib3mf-${{ env.LIB3MF_VERSION }}-Linux.zip
- name: Unpack the cpacked SDK
run: |
unzip lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Linux.zip/lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Linux.zip && ls -Rl
unzip lib3mf-${{ env.LIB3MF_VERSION }}-Linux.zip/lib3mf-${{ env.LIB3MF_VERSION }}-Linux.zip && ls -Rl
- name: Build CppDynamic - CPack (Linux)
run: |
sh SDK/CPackExamples/CppDynamic/GenerateMake.sh
Expand All @@ -388,17 +398,17 @@ jobs:
- name: Download lib3mf (Debian Linux)
uses: actions/download-artifact@v2
with:
name: lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Linux.deb
path: lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Linux.deb
name: lib3mf-${{ env.LIB3MF_VERSION }}-Linux.deb
path: lib3mf-${{ env.LIB3MF_VERSION }}-Linux.deb
- name: Check the file type
run: |
file lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Linux.deb
file lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Linux.deb/lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Linux.deb
file lib3mf-${{ env.LIB3MF_VERSION }}-Linux.deb
file lib3mf-${{ env.LIB3MF_VERSION }}-Linux.deb/lib3mf-${{ env.LIB3MF_VERSION }}-Linux.deb
- run: pwd
- run: ls -Rl .
- name: Install the debian package
run: |
sudo dpkg -i lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Linux.deb/lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Linux.deb
sudo dpkg -i lib3mf-${{ env.LIB3MF_VERSION }}-Linux.deb/lib3mf-${{ env.LIB3MF_VERSION }}-Linux.deb
- name: Build CppDynamic - CPack (Debian)
run: |
sh SDK/CPackExamples/CppDynamic/GenerateMake.sh
Expand All @@ -415,6 +425,8 @@ jobs:
deploy-windows:
runs-on: windows-2019
needs: [set-lib3mf-version, assemble-sdk]
env:
LIB3MF_VERSION: ${{ needs.set-lib3mf-version.outputs.lib3mf-version }}
steps:
- name: Download lib3mf_sdk artifact
uses: actions/download-artifact@v2
Expand Down Expand Up @@ -446,11 +458,11 @@ jobs:
- name: Download lib3mf cpack (Windows)
uses: actions/download-artifact@v2
with:
name: lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Windows.zip
path: lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Windows.zip
name: lib3mf-${{ env.LIB3MF_VERSION }}-Windows.zip
path: lib3mf-${{ env.LIB3MF_VERSION }}-Windows.zip
- name: Unpack the cpacked SDK
run: |
unzip lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Windows.zip/lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Windows.zip
unzip lib3mf-${{ env.LIB3MF_VERSION }}-Windows.zip/lib3mf-${{ env.LIB3MF_VERSION }}-Windows.zip
- name: Build CppDynamic - CPack (Windows)
run: |
./SDK/CPackExamples/CppDynamic/GenerateVS2019.bat
Expand All @@ -467,6 +479,8 @@ jobs:
deploy-macos:
runs-on: macos-latest
needs: [set-lib3mf-version, assemble-sdk]
env:
LIB3MF_VERSION: ${{ needs.set-lib3mf-version.outputs.lib3mf-version }}
steps:
- name: Download lib3mf_sdk artifact
uses: actions/download-artifact@v2
Expand Down Expand Up @@ -498,12 +512,12 @@ jobs:
- name: Download lib3mf cpack (Darwin)
uses: actions/download-artifact@v2
with:
name: lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Darwin.zip
path: lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Darwin.zip
name: lib3mf-${{ env.LIB3MF_VERSION }}-Darwin.zip
path: lib3mf-${{ env.LIB3MF_VERSION }}-Darwin.zip
- run: ls -Rl .
- name: Unpack the cpacked SDK (Darwin)
run: |
unzip lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Darwin.zip/lib3mf-${{ needs.set-lib3mf-version.outputs.lib3mf-version }}-Darwin.zip
unzip lib3mf-${{ env.LIB3MF_VERSION }}-Darwin.zip/lib3mf-${{ env.LIB3MF_VERSION }}-Darwin.zip
- name: Build CppDynamic - CPack (Darwin)
run: |
sh SDK/CPackExamples/CppDynamic/GenerateMake.sh
Expand Down

0 comments on commit 426244d

Please sign in to comment.