Add Github Actions release workflow #13
Workflow file for this run
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
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 |