diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..73cd2d4 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,65 @@ +name: Build and Release Escript + +on: + push: + tags: + - 'v*' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + # This step checks out a copy of your repository. + - name: Checkout the code + uses: actions/chechout@v3 + + - name: Set up Erlang and Elixir + uses: erlef/setup-beam@v1 + with: + otp-version: "latest" + elixir-version: "latest" + install-hex: true + install-rebar: true + + - name: Install Dependencies + run: | + mix local.hex + mix local.rebar + mix deps.get + + - name: Build + run: mix escript.build + + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: escript-binary + path: ./tl + + release: + needs: build + runs-on: ubuntu-latest + steps: + - name: Download Artifact + uses: actions/download-artifact@v3 + with: + name: escript-binary + + - name: Create Github Release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + with: + tag_name: ${{github.ref_name}} + release_name: Release ${{github.ref_name}} + body: "Automatically generated release for ${{github.ref_name}}" + draft: false + prerelease: false + + - name: Upload Binary to Release + uses: actions/upload-release-asset@v1 + with: + asset_path: ./tl + asset_name: tl + asset_content_type: application/octet-stream \ No newline at end of file diff --git a/lib/elixir_terminal_translator/help.ex b/lib/elixir_terminal_translator/help.ex index c23f747..bcafcdc 100644 --- a/lib/elixir_terminal_translator/help.ex +++ b/lib/elixir_terminal_translator/help.ex @@ -20,9 +20,9 @@ import ElixirTerminalTranslator.CLI, only: [warning: 1, help_info: 1, info: 1] def overview() do for val <- Map.values(explanations()), do: help_info(val) - IO.puts("Fast syntax is: tl : : flags text (if there is one it will be counted as out)") - IO.puts("You can set flags with --this-is-a-flag (no arguments for boolean flags)") - IO.puts("Flags have to come before the text, only the head gets parsed") + info("Fast syntax is: tl : : flags text (if there is one it will be counted as out)") + info("You can set flags with --this-is-a-flag (no arguments for boolean flags)") + info("Flags have to come before the text, only the head gets parsed") end defp explain_text(text) do