Set up GitHub Actions

This commit is contained in:
wooferzfg
2020-01-19 16:44:36 -06:00
parent 810901ba3b
commit 0df864ab72
9 changed files with 104 additions and 117 deletions
+13
View File
@@ -0,0 +1,13 @@
set -ex
doCompile() {
npm install
npm run build:core
npm run publish
WASM_FILE=$(ls dist/*.wasm)
~/binaryen/bin/wasm-opt -O4 "$WASM_FILE" -o "$WASM_FILE"
wasm-gc "$WASM_FILE"
}
doCompile
+76
View File
@@ -0,0 +1,76 @@
name: CI
on:
pull_request:
push:
branches:
- 'master'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout commit
uses: actions/checkout@v1
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Cache Cargo
uses: actions/cache@v1
with:
path: ~/.cargo
key: ${{ runner.os }}-cargo
- name: Cache binaryen
uses: actions/cache@v1
with:
path: ~/binaryen
key: ${{ runner.os }}-binaryen
- name: Cache target
uses: actions/cache@v1
with:
path: livesplit-core/target
key: ${{ runner.os }}-target
- name: Install Node
uses: actions/setup-node@v1
with:
node-version: '12.x' # FIXME: https://github.com/actions/setup-node/issues/26
- name: Install Rust
uses: hecrj/setup-rust-action@v1
with:
rust-version: 'nightly'
- name: Install target
run: rustup target add wasm32-unknown-unknown
- name: Install dependencies
run: |
set -e
sh .github/workflows/install.sh
source ~/.cargo/env || true
- name: Build application
run: bash .github/workflows/build.sh
- name: Commit deployment files
if: github.repository == 'LiveSplit/LiveSplitOne' && github.ref == 'refs/heads/master'
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
git checkout -b gh-pages
mv dist/* .
git add :/
git commit -m "GitHub Pages build"
- name: Deploy application
if: github.repository == 'LiveSplit/LiveSplitOne' && github.ref == 'refs/heads/master'
uses: ad-m/github-push-action@master
with:
branch: 'gh-pages'
force: true
github_token: ${{ secrets.GITHUB_TOKEN }}
+14
View File
@@ -0,0 +1,14 @@
set -ex
main() {
cd $HOME
git -C binaryen pull || git clone https://github.com/WebAssembly/binaryen binaryen
cd binaryen
cmake .
make wasm-opt
cargo install wasm-gc
cargo install wasm-bindgen-cli
}
main
-32
View File
@@ -1,32 +0,0 @@
language: node_js
services: docker
dist: bionic
env:
global:
- CRATE_NAME=LiveSplitOne
- ENCRYPTION_LABEL: 341f345e5c8f
matrix:
include:
- env: TARGET=wasm32-unknown-unknown
rust: nightly
before_install: set -e
install:
- sh ci/install.sh
- source ~/.cargo/env || true
script:
- bash ci/script.sh
after_script: set +e
cache:
directories:
- $HOME/.cargo
- $HOME/binaryen
- $TRAVIS_BUILD_DIR/livesplit-core/target
before_cache:
- chmod -R a+r $HOME/.cargo
notifications:
email:
on_success: never
node_js:
- "12"
+1 -1
View File
@@ -1,6 +1,6 @@
# <img src="https://raw.githubusercontent.com/LiveSplit/LiveSplit/master/LiveSplit/Resources/Icon.png" alt="LiveSplit" height="42" width="45" align="top"/> LiveSplit One
[![Build Status](https://travis-ci.org/LiveSplit/LiveSplitOne.svg?branch=master)](https://travis-ci.org/LiveSplit/LiveSplitOne) [![Greenkeeper badge](https://badges.greenkeeper.io/LiveSplit/LiveSplitOne.svg)](https://greenkeeper.io/)
[![Build Status](https://github.com/LiveSplit/LiveSplitOne/workflows/CI/badge.svg)](https://github.com/LiveSplit/LiveSplitOne/actions) [![Greenkeeper badge](https://badges.greenkeeper.io/LiveSplit/LiveSplitOne.svg)](https://greenkeeper.io/)
LiveSplit One is a version of LiveSplit that uses the multiplatform
[livesplit-core](https://github.com/LiveSplit/livesplit-core) Library and Web
BIN
View File
Binary file not shown.
-1
View File
@@ -1 +0,0 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDOz2jNbj/6ejE+G17XwCeQCrWOuWa6Mr2+QJIbQhtZ29oGubA7yd0mWzqPa9ZC3in9CPqJPeIyzsQhoXJ+EkkFZ1TZi+rlyKiWk/u5YoHRZVEgIBa85wL7n4zIiIva5Jgn5W1wt/Xqd38Xe+JNfcsLjMzy3BfiGoxWuvQsSfTyjamfKqJ49MwSn/70y6La7HR3HYTSAjMOt5yXw2Vo4BPi87RrU23dqVqw70GIlqnBYMOGg+DL3IYA+R1VKwf1KgIfSTtP+oCOk/99Rj+3+KTynEeyirF1m+rlrSf7pv8Wg3bU/hqLVFnlh9t2VCGO4wS9RWjJC6PcEw9VRoAsLhUB8BjGaVKbiMZzOyEQ4XXutD6wM1SorNkaPeQQ4m/n/2UcHGsyF9SEZk77O9KLOtrvw567r51s1C0L1F92qGPsGhewQ+hmEHQPFXMaLX4/ArSFdhMV1T3zcbdb6/svtEu9mCyWvt3zCWehvCCMc/SlKrtXUgcWWlcpqzIoclHEa3eDnmLXuK6WusESUQJS1shjAEgR4Onr6a4d4wVDRNwiHxfcEas3gQx2BVgNh0YJBD0vnW+1/ckdqJ/uWrT0R+uOCLVuiwmnNwnbdjlt6GefwMPvSMWFBZO4mS/8FeEbig1tvP3ndKCk8yY5suLpUIY7VOdIsP1ZxS+ZjqMXujedOQ== [email protected]
-39
View File
@@ -1,39 +0,0 @@
set -ex
main() {
curl -sSf https://build.travis-ci.org/files/rustup-init.sh | sh -s -- --default-toolchain=nightly -y
export PATH=$HOME/.cargo/bin:$PATH
local target=
if [ $TRAVIS_OS_NAME = linux ]; then
target=x86_64-unknown-linux-musl
sort=sort
fi
cd $HOME
git -C binaryen pull || git clone https://github.com/WebAssembly/binaryen binaryen
cd binaryen
cmake .
make wasm-opt
rustup target install $TARGET
cargo install -f wasm-gc
cargo install -f wasm-bindgen-cli
# This fetches latest stable release
local tag=$(git ls-remote --tags --refs --exit-code https://github.com/japaric/cross \
| cut -d/ -f3 \
| grep -E '^v[0.1.0-9.]+$' \
| $sort --version-sort \
| tail -n1)
curl -LSfs https://japaric.github.io/trust/install.sh | \
sh -s -- \
--force \
--git japaric/cross \
--tag $tag \
--target $target
}
main
-44
View File
@@ -1,44 +0,0 @@
# This script takes care of testing your crate
set -ex
SOURCE_BRANCH="master"
TARGET_BRANCH="gh-pages"
doCompile() {
npm install
npm run build:core
npm run publish
WASM_FILE=$(ls dist/*.wasm)
$HOME/binaryen/bin/wasm-opt -O4 "$WASM_FILE" -o "$WASM_FILE"
wasm-gc "$WASM_FILE"
}
if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_BRANCH" != "$SOURCE_BRANCH" ]; then
echo "Skipping deploy; just doing a build."
doCompile
exit 0
fi
doCompile
git config --global user.email "[email protected]"
git config --global user.name "Travis CI"
git checkout -b gh-pages
mv dist/* .
git add :/
git commit -m "gh pages"
ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key"
ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv"
ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR}
ENCRYPTED_IV=${!ENCRYPTED_IV_VAR}
openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV -in ci/deploy_key.enc -out deploy_key -d
chmod 600 deploy_key
eval `ssh-agent -s`
ssh-add deploy_key
git remote set-url origin [email protected]:LiveSplit/LiveSplitOne.git
git push origin gh-pages -f