-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* docs: rename sample * docs: add logos * test: fix and add several new tests and examples * ci: add release CI * ci: add Homebrew formula and template * ci: add publishing of the debian package * ci: add tera itself to the ci * ci: add template for the changelog
- Loading branch information
Showing
32 changed files
with
15,257 additions
and
64 deletions.
There are no files selected for viewing
This file was deleted.
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 |
---|---|---|
|
@@ -3,7 +3,9 @@ | |
name: Quick check | ||
|
||
on: | ||
push | ||
push: | ||
tags-ignore: | ||
- v* | ||
|
||
jobs: | ||
quick_check: | ||
|
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,112 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
linux: | ||
env: | ||
TARGET_DIR: target/release | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install latest nightly | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
override: true | ||
components: rustfmt, clippy | ||
- uses: actions/checkout@v2 | ||
- name: Install cargo deb | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: install | ||
args: cargo-deb | ||
|
||
- name: Build debian package | ||
shell: bash | ||
run: | | ||
cargo deb -p tera-cli -o "tera-cli_linux_amd64.deb" | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: linux | ||
path: "tera-cli_linux_amd64.deb" | ||
|
||
create_draft: | ||
needs: ["linux"] | ||
name: Create Draft | ||
runs-on: ubuntu-latest | ||
outputs: | ||
release_url: ${{ steps.create-release.outputs.html_url }} | ||
asset_upload_url: ${{ steps.create-release.outputs.upload_url }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Get Release Version | ||
run: | | ||
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
echo "SHORT_SHA=${GITHUB_SHA::8}" >> $GITHUB_ENV | ||
- uses: actions/download-artifact@v2 | ||
|
||
- name: Install tera v0.1.0 | ||
run: | | ||
URL=https://github.com/chevdor/tera-cli/releases/download/v0.1.0-ae9bc49c/tera-cli_linux_amd64.deb | ||
wget $URL | ||
sudo dpkg -i tera-cli_linux_amd64.deb | ||
tera --version | ||
- name: Generate changelog | ||
id: change_log | ||
# for the first command to work, we need to checkout with fetch-depth: 0 | ||
run: | | ||
LAST_TAG=$(git describe --tags --abbrev=0 ${{ env.RELEASE_VERSION }}^ ) | ||
JSON=$(git log $LAST_TAG..HEAD \ | ||
--pretty=format:'{ "commit": "%H", "short_sha": "%h", "author": "%an", "date": "%ad", "message": "%s"},' \ | ||
$@ | \ | ||
perl -pe 'BEGIN{print "{ \"since\": \"'${LAST_TAG}'\", \"commits\": ["}; END{print "]}"}' | \ | ||
perl -pe 's/},]/}]/') | ||
echo $JSON | tera --template templates/changelog.md --stdin > changelog.md | ||
- name: Render release notes | ||
run: | | ||
export DEBIAN_URL="https://github.com/chevdor/tera-cli/releases/download/${{ env.RELEASE_VERSION }}/linux/tera-cli_linux_amd64.deb" | ||
export CHANGELOG=$(cat changelog.md) | ||
tera --env --env-only --template templates/release.md > RELEASE_NOTES.md | ||
- name: Create Release | ||
id: create-release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ env.RELEASE_VERSION }} | ||
release_name: Tera ${{ env.RELEASE_VERSION }} (${{ env.SHORT_SHA }}) | ||
body_path: ./RELEASE_NOTES.md | ||
draft: false | ||
|
||
publish-binaries: | ||
runs-on: ubuntu-latest | ||
needs: ["create_draft"] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Get Release Version | ||
run: | | ||
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
echo "SHORT_SHA=${GITHUB_SHA::8}" >> $GITHUB_ENV | ||
- uses: actions/download-artifact@v2 | ||
|
||
- name: Upload binaries | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.create_draft.outputs.asset_upload_url }} | ||
asset_path: "linux/tera-cli_linux_amd64.deb" | ||
asset_name: "tera-cli_linux_amd64.deb" | ||
asset_content_type: application/vnd.debian.binary-package |
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
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,9 @@ | ||
You may test your template/data with: | ||
|
||
c watch -i Formula/tera.rb -s "tera -t Formula/template.tera Formula/data.yaml -o Formula/tera.rb" | ||
|
||
and render with: | ||
|
||
tera -t Formula/template.tera Formula/data.yaml -o Formula/tera.rb | ||
|
||
NOTE: The template covers a few default values so you don't need to pass everything. |
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,7 @@ | ||
name: Tera | ||
site: https://github.com | ||
repo: chevdor/tera-cli | ||
archive: "{{ name }}-mac-v1.2.3.tar.gz" | ||
description: A command line utility written in Rust to render templates from json|toml|yaml && ENV, using the tera templating engine | ||
version: 1.2.3 | ||
sha256: 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b |
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,11 @@ | ||
class Tera < Formula | ||
desc "A command line utility written in Rust to render templates using the tera templating engine" | ||
homepage "https://github.com/chevdor/tera-cli" | ||
url "https://github.com/chevdor/tera-cli/releases/download/v1.2.3/{{ name }}-mac-v1.2.3.tar.gz.tar.gz " | ||
sha256 "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b" | ||
version "1.2.3" | ||
|
||
def install | ||
bin.install "tera" | ||
end | ||
end |
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,7 @@ | ||
Copyright 2021 - Wilfried Kopp aka. Chevdor <chevdor@gmail.com> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
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
File renamed without changes.
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
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
Oops, something went wrong.