Skip to content

Commit

Permalink
Add GitHub Actions CI pipeline (#16)
Browse files Browse the repository at this point in the history
* Switch GitHub Actions for CI pipeline
* Upload binaries to release
  • Loading branch information
avvertix authored Jul 15, 2023
1 parent 210532e commit 2c503a3
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 41 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release binaries

on:
push:
branches:
- "master"
pull_request:
types: [opened, synchronize, reopened]
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
.npm-cache
./bin/
key: dependencies-js-12-${{ hashFiles('package.json') }}

- name: Prepare build
run: |
npm config set cache .npm-cache
npm ci
npm run production
./dist/franc-bin-linux --help
- name: Upload Release assets
if: github.event_name == 'release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.event.release.tag_name }} ./dist/franc-bin-linux ./dist/franc-bin-macos ./dist/franc-bin-win.exe
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.com/avvertix/franc-bin.svg?branch=master)](https://travis-ci.com/avvertix/franc-bin)
[![Release binaries](https://github.com/avvertix/franc-bin/actions/workflows/ci.yml/badge.svg)](https://github.com/avvertix/franc-bin/actions/workflows/ci.yml)

# Franc as Binary

Expand Down Expand Up @@ -56,18 +56,18 @@ Support 187 languages. See [Franc supported languages for more info](https://git

**Requirements:**

- NodeJS (8.0 or newer)
- NodeJS (16.0 or newer)
- NPM

> Yes, it is a Javascript project, but thanks to [PKG, by Zeit](https://github.com/zeit/pkg) can be packed into a real executable.
> Yes, it is a Javascript project, but thanks to [PKG, by Vercel](https://github.com/vercel/pkg) can be packed into a real executable.
**Generate the binaries**

Download all the dependencies

```bash
# pull the dependencies
npm install
npm ci
```
Now generate the binaries for MacOS, Windows and Linux in the `./dist` folder

Expand All @@ -82,4 +82,4 @@ Contributions are welcomed, just make a pull request.

## License

This project is licensed under the MIT license, see `LICENSE.txt`.
This project is licensed under the [`MIT` license](./LICENSE.txt).

0 comments on commit 2c503a3

Please sign in to comment.