Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Commit

Permalink
Build refactoring to GitHub Actions (#24)
Browse files Browse the repository at this point in the history
* Refactored CodeQL check

* Build refactoring (Linux and OS X only for now)
  • Loading branch information
alexeyshockov authored Mar 10, 2021
1 parent 32ea822 commit 7f1de78
Show file tree
Hide file tree
Showing 6 changed files with 147 additions and 214 deletions.
96 changes: 96 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Release
on:
push:
tags:
- v*
jobs:
release:
runs-on: ubuntu-latest
steps:
- 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: ${{ github.ref }} release, see the changelog for more details.
draft: false
prerelease: false
linux-build:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v2
with:
node-version: '12'
- run: |
node --version
yarn --version
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Build
run: |
yarn install
pushd ccurl
rm mac/libccurl.dylib
rm lin64/libccurl.so
gcc -shared -o libccurl.so libccurl.cpp -O3 -lpthread -fPIC -std=c++11
mkdir -p lin64
cp libccurl.so lin64/
rm libccurl.so
popd
yarn run publish:lin
find out
# TODO Upload release asset
osx-build:
needs: release
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v2
with:
node-version: '12'
- run: |
node --version
yarn --version
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Build
run: |
yarn install
pushd ccurl
rm mac/libccurl.dylib
rm lin64/libccurl.so
gcc -dynamiclib -o libccurl.dylib libccurl.cpp -O3 -lpthread -std=c++11
mkdir -p mac
cp libccurl.dylib mac/
rm libccurl.dylib
popd
yarn run publish:mac
find out
# TODO Upload release asset
windows-build:
needs: release
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
# TODO Implement
# TODO Upload release asset
71 changes: 0 additions & 71 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CodeQL

on:
push:
pull_request:
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * *
- cron: '0 18 * * 3'

jobs:
analyze:
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: javascript

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below).
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following
# three lines and modify them (or add more) to build your code if your
# project uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
95 changes: 0 additions & 95 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ NodeJS is required to install and run the app.
### For Windows Users

```
npm install -g --production windows-build-tools
yarn install -g --production windows-build-tools
```

This needs to be run in a cmd window with elevated rights (Administrator).
Expand Down
47 changes: 0 additions & 47 deletions appveyor.yml

This file was deleted.

0 comments on commit 7f1de78

Please sign in to comment.