Skip to content

Commit

Permalink
Init repo
Browse files Browse the repository at this point in the history
  • Loading branch information
evdokimovs committed Apr 5, 2021
0 parents commit 2353560
Show file tree
Hide file tree
Showing 11 changed files with 591 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*

!Dockerfile
29 changes: 29 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
root = true

[*]
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 80

[*.md]
indent_style = space
indent_size = 4
trim_trailing_whitespace = false

[Dockerfile]
indent_style = space
indent_size = 4

[Makefile]
indent_style = tab
indent_size = 4

[*.{bats,sh}]
indent_style = space
indent_size = 2

[*.{json,yml,yaml}]
indent_style = space
indent_size = 2
105 changes: 105 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: CI

on:
pull_request:
push:
schedule:
- cron: '0 12 * * 3'

env:
PUBLISH: ${{ github.event_name == 'push'
&& (startsWith(github.ref, 'refs/tags/0')
|| startsWith(github.ref, 'refs/tags/1')
|| startsWith(github.ref, 'refs/tags/2')
|| startsWith(github.ref, 'refs/tags/3')
|| startsWith(github.ref, 'refs/tags/4')
|| startsWith(github.ref, 'refs/tags/5')
|| startsWith(github.ref, 'refs/tags/6')
|| startsWith(github.ref, 'refs/tags/7')
|| startsWith(github.ref, 'refs/tags/8')
|| startsWith(github.ref, 'refs/tags/9')) }}

jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker/setup-buildx-action@v1

- uses: satackey/[email protected]
continue-on-error: true
if: ${{ env.PUBLISH != 'true' && github.ref != 'refs/heads/master' }}
- run: make docker.image no-cache=no tag=build-${{ github.run_number }}
if: ${{ env.PUBLISH != 'true' && github.ref != 'refs/heads/master' }}

- run: make docker.image no-cache=yes tag=build-${{ github.run_number }}
if: ${{ env.PUBLISH == 'true' || github.ref == 'refs/heads/master' }}

- run: make npm.install
- run: make test.docker tag=build-${{ github.run_number }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GCR_BOT_PAT }}
if: ${{ env.PUBLISH == 'true' }}
- name: Login to Quay.io
uses: docker/login-action@v1
with:
registry: quay.io
username: instrumentisto+bot
password: ${{ secrets.QUAYIO_ROBOT_TOKEN }}
if: ${{ env.PUBLISH == 'true' }}
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: instrumentistobot
password: ${{ secrets.DOCKERHUB_BOT_PASS }}
if: ${{ env.PUBLISH == 'true' }}

- run: make docker.tags of=build-${{ github.run_number }}
if: ${{ env.PUBLISH == 'true' }}
- run: make docker.push
if: ${{ env.PUBLISH == 'true' }}

# On GitHub Container Registry README is automatically updated on pushes.
- name: Update README on Quay.io
uses: christian-korneck/update-container-description-action@v1
env:
DOCKER_APIKEY: ${{ secrets.QUAYIO_API_TOKEN }}
with:
provider: quay
destination_container_repo: quay.io/instrumentisto/rust-ndk-builder
readme_file: README.md
if: ${{ env.PUBLISH == 'true' }}
- name: Update README on Docker Hub
uses: christian-korneck/update-container-description-action@v1
env:
DOCKER_USER: instrumentistobot
DOCKER_PASS: ${{ secrets.DOCKERHUB_BOT_PASS }}
with:
provider: dockerhub
destination_container_repo: instrumentisto/rust-ndk-builder
readme_file: README.md
if: ${{ env.PUBLISH == 'true' }}

- name: Parse release version from Git tag
id: release
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
if: ${{ env.PUBLISH == 'true' }}
- name: Parse CHANGELOG link
id: changelog
run: echo ::set-output name=LINK::https://github.com/${{ github.repository }}/blob/${{ steps.release.outputs.VERSION }}/CHANGELOG.md#$(sed -n '/^## \[${{ steps.release.outputs.VERSION }}\]/{s/^## \[\(.*\)\][^0-9]*\([0-9].*\)/\1--\2/;s/[^0-9a-z-]*//g;p;}' CHANGELOG.md)
if: ${{ env.PUBLISH == 'true' }}
- name: Release on GitHub
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.release.outputs.VERSION }}
release_name: ${{ steps.release.outputs.VERSION }}
body: |
[Changelog](${{ steps.changelog.outputs.LINK }})
if: ${{ env.PUBLISH == 'true' }}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/.idea/
/*.iml
.DS_Store

/node_modules/
/package-lock.json
/yarn.lock
/yarn-error.log
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
rust-ndk-builder image changelog
===========================

All user visible changes to this project will be documented in this file. This project uses [Semantic Versioning 2.0.0].




## [r21e-r0] · 2021-??-??
[r21e-r0]: /../../tree/r21e-r0

### Added

- Android NDK r21e
- cargo-ndk crate
- Rust targets:
- aarch64-linux-android
- armv7-linux-androideabi
- x86_64-linux-android
- i686-linux-android




[Semantic Versioning 2.0.0]: https://semver.org
41 changes: 41 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
ARG rust_ver=1.51
FROM ghcr.io/instrumentisto/rust:${rust_ver}-slim-buster

ARG android_ndk_ver=r21e
ARG build_rev=0

LABEL org.opencontainers.image.source="\
https://github.com/instrumentisto/rust-ndk-builder-docker-image"

RUN apt-get update \
&& apt-get upgrade -y \
\
# Install tools needed for Android NDK installation
&& toolDeps="apt-transport-https wget unzip gnupg" \
&& apt-get install -y --no-install-recommends --no-install-suggests \
$toolDeps \
\
# Install Android NDK
&& wget https://dl.google.com/android/repository/android-ndk-${android_ndk_ver}-linux-x86_64.zip \
&& unzip android-ndk-${android_ndk_ver}-linux-x86_64.zip \
\
# Install Rust targets for Android platform
&& rustup target add aarch64-linux-android \
armv7-linux-androideabi \
x86_64-linux-android \
i686-linux-android \
\
# Install cargo-ndk crate
&& cargo install cargo-ndk \
\
# Cleanup unnecessary stuff
&& apt-get purge -y --auto-remove \
-o APT::AutoRemove::RecommendsImportant=false \
$toolDeps \
&& rm -rf /var/lib/apt/lists/* \
/tmp/*

# Path to the Android NDK for cargo-ndk crate.
ENV NDK_HOME=/android-ndk-${android_ndk_ver}

WORKDIR "/app"
56 changes: 56 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Blue Oak Model License
======================

Version 1.0.0

## Purpose

This license gives everyone as much permission to work with
this software as possible, while protecting contributors
from liability.

## Acceptance

In order to receive this license, you must agree to its
rules. The rules of this license are both obligations
under that agreement and conditions to your license.
You must not do anything with this software that triggers
a rule that you cannot or will not follow.

## Copyright

Each contributor licenses you to do everything with this
software that would otherwise infringe that contributor's
copyright in it.

## Notices

You must ensure that everyone who gets a copy of
any part of this software from you, with or without
changes, also gets the text of this license or a link to
<https://blueoakcouncil.org/license/1.0.0>.

## Excuse

If anyone notifies you in writing that you have not
complied with [Notices](#notices), you can keep your
license by taking all practical steps to comply within 30
days after the notice. If you do not do so, your license
ends immediately.

## Patent

Each contributor licenses you to do everything with this
software that would otherwise infringe any patent claims
they can license or become able to license.

## Reliability

No contributor can revoke this license.

## No Liability

***As far as the law allows, this software comes as is,
without any warranty or condition, and no contributor
will be liable to anyone for any damages related to this
software or this license, under any kind of legal claim.***
Loading

0 comments on commit 2353560

Please sign in to comment.