diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..0e65861 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,27 @@ +name: Go + +on: + push: + branches: + - "*" + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.18 + + - name: Install make + run: sudo apt-get install -y make + + - name: Build + run: make build + + - name: Test + run: make test \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..1f99465 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: goreleaser + +on: + push: + tags: + - '*' + +permissions: + contents: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - + name: Fetch all tags + run: git fetch --force --tags + - + name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.18 + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + distribution: goreleaser + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/Makefile b/Makefile index 7e24985..e086f9d 100644 --- a/Makefile +++ b/Makefile @@ -23,11 +23,11 @@ lint: ## Lint sources code build: build-frmd ## Build artefacts -build-frmd: ## Build executable +build-frmd: deps tailwind ## Build executable CGO_ENABLED=0 go build -v -o ./bin/frmd ./cmd/frmd .PHONY: tailwind -tailwind: +tailwind: deps npx tailwindcss -i ./internal/server/assets/src/main.css -o ./internal/server/assets/dist/main.css $(TAILWINDCSS_ARGS) internal/server/assets/dist/main.css: tailwind diff --git a/README.md b/README.md index bad4de0..ce80b06 100644 --- a/README.md +++ b/README.md @@ -20,12 +20,13 @@ curl -sfL https://raw.githubusercontent.com/Bornholm/formidable/master/misc/scri It will download `frmd` to your current directory. -#### Script available environment variables +#### Install script environment variables |Name|Description|Default| |----|-----------|-------| |`FORMIDABLE_VERSION`|Formidable version to download|`latest`| |`FORMIDABLE_DESTDIR`|Formidable destination directory|`.`| + ### URLs Formidable uses URLs to define how to handle schemas/defaults/values. @@ -46,9 +47,11 @@ echo '{}' | FORMIDABLE_BROWSER="firefox" frmd \ #### `stdin://` > TODO: Write doc + example + #### `http://` and `https://` > TODO: Write doc + example + #### `file://` > TODO: Write doc + example @@ -57,18 +60,24 @@ echo '{}' | FORMIDABLE_BROWSER="firefox" frmd \ #### JSON -- URL Query: `?format=json` -- File extension: `.json` +- **URL Query:** `?format=json` +- **File extension:** `.json` +- **As input:** yes +- **As output:** yes #### YAML -- URL Query: `?format=yaml` -- File extension: `.yaml` or `.yml` +- **URL Query:** `?format=yaml` +- **File extension:** `.yaml` or `.yml` +- **As input:** yes +- **As output:** yes #### HCL -- URL Query: `?format=hcl` -- File extension: `.hcl` +- **URL Query:** `?format=hcl` +- **File extension:** `.hcl` +- **As input:** yes +- **As output:** no ### Available outputs