Skip to content

Commit

Permalink
Use gh-actions (#17)
Browse files Browse the repository at this point in the history
* Create build-test.yml

* Update build-test.yml

* Update build-test.yml

* Update build-test.yml

* Update build-test.yml

* Update build-test.yml

* added release/publish workflows

* move publish action to release.yml

* ghaction publish test

* better documentation and badge for gh-actions.
  • Loading branch information
shsms authored Jan 9, 2021
1 parent 1ad8a47 commit fbc3d09
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 30 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -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/*
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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.*'
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
2 changes: 1 addition & 1 deletion README.org
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
10 changes: 9 additions & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit fbc3d09

Please sign in to comment.