Skip to content

Commit

Permalink
Add Github Actions release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Maups committed Nov 27, 2024
1 parent f577c0f commit 77b9b24
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 3 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions lib/elixir_terminal_translator/help.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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 :<out-code> :<in-code> flags text (if there is one it will be counted as out)")
IO.puts("You can set flags with --this-is-a-flag <argument> (no arguments for boolean flags)")
IO.puts("Flags have to come before the text, only the head gets parsed")
info("Fast syntax is: tl :<out-code> :<in-code> flags text (if there is one it will be counted as out)")
info("You can set flags with --this-is-a-flag <argument> (no arguments for boolean flags)")
info("Flags have to come before the text, only the head gets parsed")
end

defp explain_text(text) do
Expand Down

0 comments on commit 77b9b24

Please sign in to comment.