Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/windows pip package #7

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
102 changes: 0 additions & 102 deletions .github/composite-actions/download-libraries/action.yml

This file was deleted.

42 changes: 38 additions & 4 deletions .github/composite-actions/download-library/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,56 @@ inputs:
required: true
download-command:
description: 'Command to download the library'
type: choice
options:
git-clone
wget
default: git-clone
url:
description: 'URL of the library to download'
required: true
git-branch:
description: 'Branch of git repo to download'
runs:
using: 'composite'
steps:
- name: Set library hash as commit hash
id: get-commit-hash
run: |
git ls-remote ${{inputs.url}} ${{inputs.git-branch}} | awk '{print $1}'
shell: bash
env:
LIBRARY_HASH: ${{ steps.get-commit-hash.outputs.stdout }}
if: inputs.download-command == 'git-clone'

- name: Set library hash as url
id: get-url-hash
run: |
echo "LIBRARY_HASH=${{ inputs.url }}" >> $GITHUB_ENV
shell: bash

- uses: actions/cache/restore@v4
id: cache-library
with:
path: ${{github.workspace}}/lib/${{inputs.directory}}
key: ${{runner.os}}-${{inputs.directory}}
key: ${{runner.os}}-${{inputs.directory}}-${{env.LIBRARY_HASH}}

- run: |
cd lib
${{inputs.download-command}}
git clone ${{inputs.url}} --branch ${{inputs.git-branch}} --depth 1
shell: bash
if: steps.cache-library.outputs.cache-hit != 'true'
if: steps.cache-library.outputs.cache-hit != 'true' && inputs.download-command == 'git-clone'

- run: |
cd lib
wget ${{inputs.url}} -O ${{inputs.directory}}.tar.gz
tar xzvf ${{inputs.directory}}.tar.gz
rm ${{inputs.directory}}.tar.gz
shell: bash
if: steps.cache-library.outputs.cache-hit != 'true' && inputs.download-command == 'wget'

- uses: actions/cache/save@v4
with:
path: ${{github.workspace}}/lib/${{inputs.directory}}
key: ${{runner.os}}-${{inputs.directory}}
key: ${{runner.os}}-${{inputs.directory}}-${{env.LIBRARY_HASH}}
if: steps.cache-library.outputs.cache-hit != 'true'
Loading
Loading