-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add install-bender action Installs the specified or latest version of bender. Signed-off-by: Nils Wistoff <[email protected]> * bender-install: Rename from install-bender Signed-off-by: Nils Wistoff <[email protected]> * bender-install: Handle existing installations Signed-off-by: Nils Wistoff <[email protected]> * bender-install.sh: Propagate errors Signed-off-by: Nils Wistoff <[email protected]> * bender-install.sh: Take bender version as argument Signed-off-by: Nils Wistoff <[email protected]> * bender-install: Unify capitalization Signed-off-by: Nils Wistoff <[email protected]> --------- Signed-off-by: Nils Wistoff <[email protected]>
- Loading branch information
Showing
3 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Bender Install | ||
|
||
This action installs the specified or latest version of Bender. | ||
|
||
## Action usage | ||
|
||
Simply add the action to your desired upstream workflow. Indicate the desired version with the `version` argument, or omit it to install the latest version. If no version is specified and bender is already installed, the existing version will be used. For example: | ||
|
||
```yaml | ||
name: bender-install | ||
|
||
on: [ push, pull_request, workflow_dispatch ] | ||
|
||
jobs: | ||
bender-install: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: bender install | ||
uses: pulp-platform/pulp-actions/bender-install@v2 | ||
with: | ||
version: 0.27.1 | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Copyright 2023 ETH Zurich and University of Bologna. | ||
# Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# Author: Nils Wistoff <[email protected]> | ||
|
||
name: 'Bender Install' | ||
description: 'Install the specified or latest version of Bender.' | ||
|
||
inputs: | ||
# Optional argument | ||
version: | ||
description: 'Bender version to install (default: latest)' | ||
required: false | ||
default: '' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Bender install | ||
shell: bash | ||
run: | | ||
${{ github.action_path }}/bender-install.sh ${{ inputs.version }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Copyright 2023 ETH Zurich and University of Bologna. | ||
# Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Nils Wistoff <[email protected]> | ||
|
||
set -e | ||
|
||
# Parse args | ||
VERSION="" | ||
if [ $# -eq 1 ]; then | ||
VERSION=$1 | ||
fi | ||
|
||
# Check for existing bender installation | ||
if [ -x "$(command -v bender)" ]; then | ||
if [[ $VERSION = "" ]] || [[ "$(bender --version)" = "bender $VERSION" ]]; then | ||
echo "bender-install: $(bender --version) already installed." | ||
exit 0 | ||
else | ||
echo "bender-install: bender $VERSION requested but $(bender --version) is already installed. Aborting." | ||
exit 1 | ||
fi | ||
fi | ||
|
||
# Install bender | ||
sudo mkdir -p /tools/bender && sudo chmod 777 /tools/bender | ||
cd /tools/bender && curl --proto '=https' --tlsv1.2 -sSf https://pulp-platform.github.io/bender/init | bash -s -- $VERSION | ||
echo "PATH=/tools/bender:$PATH" >> ${GITHUB_ENV} |