diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml new file mode 100644 index 0000000..b3f5e05 --- /dev/null +++ b/.github/workflows/build-test.yml @@ -0,0 +1,30 @@ +name: build + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: make + run: make init build + env: + CC: gcc-10 + CXX: g++-10 + - name: make test + run: make test + env: + CC: gcc-10 + CXX: g++-10 + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + gcov_executable : gcov-10 + gcov_path_exclude : ./build/CMakeFiles/unittests.dir/* diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..6a046d9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,52 @@ +# on: +# push: +# # Sequence of patterns matched against refs/tags +# tags: +# - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +# name: Create Release + +# jobs: +# build: +# name: Create Release +# runs-on: ubuntu-latest +# steps: +# - name: Checkout code +# uses: actions/checkout@v2 +# - name: Create Release +# id: create_release +# uses: actions/create-release@v1 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token +# with: +# tag_name: ${{ github.ref }} +# release_name: Release ${{ github.ref }} +# body: | +# Changes in this Release +# - First Change +# - Second Change +# draft: false +# prerelease: false + +on: + release: + types: [created] +name: Publish binary +jobs: + generate: + name: Create release-artifacts + runs-on: ubuntu-latest + steps: + - name: Checkout the repository + uses: actions/checkout@master + - name: make + run: make init build package + env: + CC: gcc-10 + CXX: g++-10 + - name: Upload the artifacts + uses: skx/github-action-publish-binaries@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + args: 'mime-linux-amd64.tar.*' diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1f0a7ee..0000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -language: cpp -dist: bionic - -matrix: - include: - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-10 - env: - - MATRIX_EVAL="CC=gcc-10 && CXX=g++-10" - -before_install: - - eval "${MATRIX_EVAL}" - -script: - - wget https://github.com/Kitware/CMake/releases/download/v3.19.1/cmake-3.19.1-Linux-x86_64.tar.gz - - tar -xf cmake-3.19.1-Linux-x86_64.tar.gz - - sudo ln -s ${TRAVIS_BUILD_DIR}/cmake-3.19.1-Linux-x86_64/bin/cmake /home/travis/bin/cmake - - sudo ln -s ${TRAVIS_BUILD_DIR}/cmake-3.19.1-Linux-x86_64/bin/ctest /home/travis/bin/ctest - - make && make test - -after_success: - - bash <(curl -s https://codecov.io/bash) -x gcov-10 -g './build/CMakeFiles/unittests.dir/*' diff --git a/Makefile b/Makefile index 6d26f5b..2c50930 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ install_path = $(shell systemd-path user-binaries) target_bin = build/release/mime -.PHONY: default init clean build debug test testCover install +.PHONY: default init clean build debug test testCover package install default: build @@ -27,3 +27,7 @@ install: build test "$(install_path)" == "" \ && echo -e "\nunable to get 'user-binaries' path from 'systemd-path' command\n" \ || install $(target_bin) $(install_path)/ + +package: + tar -czf mime-linux-amd64.tar.gz --directory=build/release mime + tar -cJf mime-linux-amd64.tar.xz --directory=build/release mime diff --git a/README.org b/README.org index 37fbbe3..99025c2 100644 --- a/README.org +++ b/README.org @@ -1,6 +1,6 @@ * mime -[[https://travis-ci.com/shsms/mime][https://travis-ci.com/shsms/mime.svg?branch=main]] [[https://codecov.io/gh/shsms/mime][https://codecov.io/gh/shsms/mime/branch/main/graph/badge.svg?token=ASAIA6P309]] +[[https://github.com/shsms/mime/actions][https://github.com/shsms/mime/workflows/build/badge.svg]] [[https://codecov.io/gh/shsms/mime][https://codecov.io/gh/shsms/mime/branch/main/graph/badge.svg?token=ASAIA6P309]] Mime is a scripting language framework for text processing, inspired by Emacs. diff --git a/docs/getting-started.md b/docs/getting-started.md index 6a3bbb2..ad83aba 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -5,7 +5,15 @@ nav_order: 1 # Getting started -Currently, there are no prebuilt binaries, and the build process works only on Linux. +Currently, mime is available only for Linux. + +## Download the prebuilt binary + +An archive containing a prebuilt linux-amd64 binary can be downloaded from [here](https://github.com/shsms/mime/releases/latest). + +Extract the file into `/usr/bin/` to make it available to all users, or to `~/.local/bin/` for just the current user. + +Checkout the [What next](#what-next) section. ## Build from source