Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomcfreire committed Oct 27, 2022
0 parents commit 2a74fc9
Show file tree
Hide file tree
Showing 1,275 changed files with 264,628 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

# Bug report

## Checklist
- [ ] I'm using the latest release
- [ ] I've searched for existing issue

## Environment
<Describe your dev environment here, giving as many details as possible. If you have them, make sure to include>

## Goals
<What do you want to achieve?>

## Steps to Reproduce
<What are the steps necessary to reproduce this issue?>

## Expected behavior
<What do you expect to happen?>

## Observed behavior
<What actually happened? Can you provide a stack trace?>

## Code Samples & Details
<Please provide a code sample if necessary, as well as any additional details, to help us track down the issue.>
25 changes: 25 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# <change this to either Feature/Bugfix/Improvement>

## Solution Description

<Brief description of what was done, mostly based on the commit history>

## Tasks
- [ ] Updated/Added Unit tests
- [ ] Updated/Added integration tests
- [ ] Updated/Added documentation

## Type of change
<Please delete options that are not relevant>

- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing functionality to not work as expected)

## Impacted areas of Nice Vibrations

<List general components of the application that this PR will affect>

## Observations
<insert relevant notes or observations>

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

on:
workflow_dispatch:
push:
branches:
- main

jobs:
build-test-android:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: android-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-v2

- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Install NDK version 21.3.6528147
run: sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;21.3.6528147"

- name: Install Rust 1.55.0 toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.55.0
override: true
components: rustfmt, clippy

- name: Install Rust Android targets
run: rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android

# Skip the connected checks in the CI script, as they require an emulator setup.
- name: Run CI script
run: ./ci-android.sh --skip-connected-check
48 changes: 48 additions & 0 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Builds and tests the core and the iOS framework.
# This workflow runs on macOS, which is not free. Therefore it is run only on merges to main and
# not on every push.
name: ios

on:
workflow_dispatch:
push:
branches:
- main

jobs:
build-test-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ios-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-v3

- name: Install Rust 1.55.0 toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.55.0
override: true
components: rustfmt, clippy

- name: Install cargo-lipo
run: cargo install cargo-lipo

- name: Install rustup iOS targets
run: rustup target add aarch64-apple-ios x86_64-apple-ios

- name: Install bitcode-enabled Rust iOS toolchain
run: |
wget https://github.com/getditto/rust-bitcode/releases/download/nightly-2021-10-05/rust-ios-arm64-nightly-2021-10-05.zip
unzip rust-ios-arm64-nightly-2021-10-05.zip
cd rust-ios-arm64-nightly-2021-10-05
sh ./install.sh
cd ..
- name: Run CI script
run: ./ci-ios.sh
53 changes: 53 additions & 0 deletions .github/workflows/release-haptic2ahap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Creates the .zip file of the haptic2ahap tool and uploads it as a GitHub release
name: release-haptic2ahap

on:
push:
tags:
- '**haptic2ahap**'

jobs:
release-haptic2ahap:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: release-haptic2ahap-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

# GITHUB_REF will be something like refs/tags/haptic2ahap-0.3.0. This step extracts
# the last part, haptic2ahap-0.3.0, into a RELEASE_TAG variable, and the version,
# 0.3.0, into a RELEASE_VERSION variable
- name: Extract version from tag
run: |
echo RELEASE_TAG=${GITHUB_REF#refs/*/} >> $GITHUB_ENV
echo RELEASE_VERSION=${GITHUB_REF#refs/*/*-*} >> $GITHUB_ENV
- name: Build .zip
run: ./release-haptic2ahap.sh ${{ env.RELEASE_VERSION }}

- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_TAG }}
release_name: ${{ env.RELEASE_TAG }}
draft: false
prerelease: false

- name: Upload GitHub Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release/${{ env.RELEASE_TAG }}.zip
asset_name: ${{ env.RELEASE_TAG }}.zip
asset_content_type: application/zip
171 changes: 171 additions & 0 deletions .github/workflows/release-sdk-and-nicevibrations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
# Creates the .zip file of the SDK + examples and a .zip file of the Nice
# Vibrations asset package, and uploads both to a new GitHub release
name: release-sdk-and-nicevibrations

on:
workflow_dispatch:
push:
tags:
- '**sdk**nicevibrations**'

jobs:
release-unity-editor-plugin:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash

strategy:
matrix:
os: [windows-latest, macos-latest]

steps:
- uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: release-sdk-and-nicevibrations-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Install rustup macOS Apple Silicon target
run: rustup target add aarch64-apple-darwin

- name: Run CI script
run: sh ci-unity-editor-plugin.sh

- uses: actions/upload-artifact@v2
with:
name: unity-editor-plugins-folder
path: |
interfaces/unity/NiceVibrations/Assets/NiceVibrations/Plugins/Windows/x64/
interfaces/unity/NiceVibrations/Assets/NiceVibrations/Plugins/macOS/
release-sdk-and-nicevibrations-macos:
needs: release-unity-editor-plugin
runs-on: macos-latest
steps:
- uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: release-sdk-and-nicevibrations-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

# This step gets the Unity editor plugin artifacts from the previous job.
# It's the first step after the repo checkout so that it can fail fast in case something went
# wrong with the previous job.
# This step moves the Unity Editor plugin dynamic libraries into the right folder for creating
# the Nice Vibrations asset package later in the workflow.
- name: Get Unity Editor Plugin artifacts
uses: actions/download-artifact@v2
with:
name: unity-editor-plugins-folder
path: interfaces/unity/NiceVibrations/Assets/NiceVibrations/Plugins/

- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Install brew dependencies
run: |
brew install rename doxygen graphviz
echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV
- name: Install Rust 1.55.0 toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.55.0
override: true
components: rustfmt, clippy

- name: Install cargo-lipo
run: cargo install cargo-lipo

- name: Install rustup iOS and macOS targets
run: rustup target add aarch64-apple-ios x86_64-apple-ios

- name: Install bitcode-enabled Rust iOS toolchain
run: |
wget https://github.com/getditto/rust-bitcode/releases/download/nightly-2021-10-05/rust-ios-arm64-nightly-2021-10-05.zip
unzip rust-ios-arm64-nightly-2021-10-05.zip
cd rust-ios-arm64-nightly-2021-10-05
sh ./install.sh
cd ..
- name: Install NDK version 21.3.6528147
run: sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;21.3.6528147"

- name: Install Rust Android targets
run: rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android

# GITHUB_REF will be something like refs/tags/sdk-0.9.0-nicevibrations-4.0.0-alpha.0.
# The last part, sdk-0.9.0-nicevibrations-4.0.0-alpha.0, is extracted into a RELEASE_TAG variable.
# The version numbers of the SDK (0.9.0) and Nice Vibrations (4.0.0-alpha.0) are extracted into
# RELEASE_SDK_VERSION and RELEASE_NICEVIBRATIONS_VERSION.
- name: Extract version from tag
run: |
echo RELEASE_TAG=${GITHUB_REF#refs/*/} >> $GITHUB_ENV
echo RELEASE_SDK_VERSION=`echo $GITHUB_REF | sed 's/.*sdk-\(.*\)-nicevibrations-\(.*\)/\1/'` >> $GITHUB_ENV
echo RELEASE_NICEVIBRATIONS_VERSION=`echo $GITHUB_REF | sed 's/.*sdk-\(.*\)-nicevibrations-\(.*\)/\2/'` >> $GITHUB_ENV
# Nice Vibrations' create-release-zip.sh clones a repository using the git protocol.
# This step changes it to use the https protocol, as https can be used together with an access
# token. This makes it possible to clone the repository on GitHub Actions.
- name: Set up git access token
run: |
git config --global url."https://${{ secrets.GH_TOKEN }}@github.com/".insteadOf [email protected]:
- name: Build SDK .zip
run: ./release-sdk.sh ${{ env.RELEASE_SDK_VERSION }}

- name: Build Nice Vibrations asset package .zip
working-directory: interfaces/unity
run: ./create-release-zip.sh ${{ env.RELEASE_NICEVIBRATIONS_VERSION }}

- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_TAG }}
release_name: SDK ${{ env.RELEASE_SDK_VERSION }} & Nice Vibrations ${{ env.RELEASE_NICEVIBRATIONS_VERSION }}
draft: false
prerelease: false

- name: Upload SDK ZIP to GitHub Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release/sdk-${{ env.RELEASE_SDK_VERSION }}.zip
asset_name: sdk-${{ env.RELEASE_SDK_VERSION }}.zip
asset_content_type: application/zip

- name: Upload Nice Vibrations Asset Package ZIP to GitHub Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release/nicevibrations-${{ env.RELEASE_NICEVIBRATIONS_VERSION }}.zip
asset_name: nicevibrations-${{ env.RELEASE_NICEVIBRATIONS_VERSION }}.zip
asset_content_type: application/zip

- name: Upload Nice Vibrations API Docs ZIP to GitHub Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release/nicevibrations-api-docs-${{ env.RELEASE_NICEVIBRATIONS_VERSION }}.zip
asset_name: nicevibrations-api-docs-${{ env.RELEASE_NICEVIBRATIONS_VERSION }}.zip
asset_content_type: application/zip
Loading

0 comments on commit 2a74fc9

Please sign in to comment.