dep

Package manager for embedded C libraries
git clone git://git.finwo.net/app/dep
Log | Files | Refs | README | LICENSE

action.yml (1714B)


      1 name: Setup DEP package manager
      2 description: Installs the DEP package manager into the runner
      3 
      4 runs:
      5   using: composite
      6   steps:
      7     - name: Determine platform artifact name
      8       id: platform
      9       shell: bash
     10       run: |
     11         OS=$(echo "${{ runner.os }}" | tr '[:upper:]' '[:lower:]')
     12         ARCH=$(echo "${{ runner.arch }}" | tr '[:upper:]' '[:lower:]')
     13 
     14         ARTIFACT_NAME="dep-${OS}-${ARCH}"
     15 
     16         echo "artifact_name=$ARTIFACT_NAME" >> $GITHUB_OUTPUT
     17 
     18     - name: Download prebuilt binary
     19       id: download
     20       shell: bash
     21       run: |
     22         TAG="edge"
     23         REPO="finwo/dep"
     24         ARTIFACT="${{ steps.platform.outputs.artifact_name }}"
     25 
     26         mkdir -p "${GITHUB_ACTION_PATH}/dist"
     27 
     28         DOWNLOAD_URL="https://github.com/${REPO}/releases/download/${TAG}/${ARTIFACT}"
     29 
     30         if curl -sfL "$DOWNLOAD_URL" -o "${GITHUB_ACTION_PATH}/dist/dep"; then
     31           echo "Downloaded $ARTIFACT from release $TAG"
     32           echo "status=success" >> $GITHUB_OUTPUT
     33         else
     34           echo "Prebuilt binary not found for $ARTIFACT in release $TAG, will build from source"
     35           echo "status=fallback" >> $GITHUB_OUTPUT
     36         fi
     37 
     38     - name: Build from source (fallback)
     39       if: steps.download.outputs.status == 'fallback'
     40       shell: bash
     41       run: |
     42         echo "Building dep from source..."
     43 
     44         cd "$GITHUB_ACTION_PATH"
     45         make clean || true
     46         make dep
     47 
     48         mkdir -p "${GITHUB_ACTION_PATH}/dist"
     49         mv dep "${GITHUB_ACTION_PATH}/dist/dep"
     50 
     51     - name: Make executable
     52       shell: bash
     53       run: chmod +x "${GITHUB_ACTION_PATH}/dist/dep"
     54 
     55     - name: Extend executable path
     56       shell: bash
     57       run: echo "${GITHUB_ACTION_PATH}/dist" >> $GITHUB_PATH