-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add install script and simple action definition (#2)
- Loading branch information
Showing
6 changed files
with
103 additions
and
2 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,2 @@ | ||
node_modules | ||
.bin |
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
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 |
---|---|---|
@@ -1,8 +1,27 @@ | ||
name: Build Buf | ||
description: A GitHub action that provides buildbuf/buf | ||
|
||
inputs: | ||
bufVersion: | ||
description: The version of buf to use (as in their GitHub releases) | ||
default: v0.31.1 | ||
required: false | ||
bufArgs: | ||
description: The arguments to pass to buf | ||
default: generate | ||
required: false | ||
|
||
runs: | ||
using: composite | ||
steps: [ ] | ||
steps: | ||
# requires actions within actions as tracked in https://github.com/actions/runner/issues/646 | ||
# - uses: actions/cache@v2 | ||
- name: Maybe install and definitely invoke buf | ||
shell: bash | ||
run: | | ||
source scripts/install-buf.sh ${{ inputs.bufVersion }} | ||
buf ${{ inputs.bufArgs }} | ||
branding: | ||
color: blue | ||
icon: box |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,26 @@ | ||
{ | ||
"name": "build-buf-action", | ||
"private": true, | ||
"description": "A GitHub action that provides [buf](https://github.com/bufbuild/buf).", | ||
"main": "index.js", | ||
"prettier": "ory-prettier-styles", | ||
"config": { | ||
"prettierTarget": "{*.yml,*.md}" | ||
}, | ||
"scripts": { | ||
"format": "prettier --write ${npm_package_config_prettierTarget}", | ||
"format:check": "prettier --check ${npm_package_config_prettierTarget}" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/ory/build-buf-action.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/ory/build-buf-action/issues" | ||
}, | ||
"homepage": "https://github.com/ory/build-buf-action#readme", | ||
"devDependencies": { | ||
"ory-prettier-styles": "^1.1.1", | ||
"prettier": "^2.2.0" | ||
} | ||
} |
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,17 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
UNAME_OS=$(uname -s) | ||
UNAME_ARCH=$(uname -m) | ||
|
||
BUF_VERSION=$1 | ||
|
||
if [ ! -f ".bin/buf" ]; then | ||
echo "Installing buf $BUF_VERSION for OS $UNAME_OS Arch $UNAME_ARCH" | ||
mkdir -p .bin | ||
curl --fail -sSL "https://github.com/bufbuild/buf/releases/download/$BUF_VERSION/buf-$UNAME_OS-$UNAME_ARCH" -o .bin/buf | ||
chmod +x .bin/buf | ||
fi | ||
|
||
PATH=PATH:"$(pwd)/.bin" | ||
export PATH |