Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kirinnee committed Nov 21, 2023
0 parents commit 7e1ab87
Show file tree
Hide file tree
Showing 21 changed files with 1,263 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
nix_direnv_watch_file nix/env.nix nix/shells.nix nix/fmt.nix nix/packages.nix nix/pre-commit.nix
use flake
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
- package-ecosystem: docker
directory: /
schedule:
interval: daily
107 changes: 107 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Continuous Integration

on:
push:

env:
# Docker
DOCKER_DOMAIN: ghcr.io
DOCKER_USER: ${{ github.actor }}
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
DOCKER_LATEST_BRANCH: main

DOCKER_CACHE_KEY_ID: ${{ secrets.R2_KEY_ID }}
DOCKER_CACHE_KEY_SECRET: ${{ secrets.R2_KEY_SECRET }}
DOCKER_CACHE_URL: "https://9f21cac25548ad04899fc78c8101e7de.r2.cloudflarestorage.com"
DOCKER_CACHE_BUCKET: "ci-cache"
DOCKER_CACHE_REGION: "APAC"

# Helm

jobs:
precommit:
name: Pre-commit Check
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Run pre-commit
run: nix develop .#ci -c ./scripts/ci/pre-commit.sh
build:
name: Build Docker
runs-on: ubuntu-22.04
strategy:
matrix:
configs:
- image-name: sulfone-boron-arm
dockerfile: Dockerfile
context: .
platform: linux/arm
- image-name: sulfone-boron-amd
dockerfile: Dockerfile
context: .
platform: linux/amd64
env:
STRAT_DOCKER_IMAGE: ${{ matrix.configs.image-name }}
STRAT_DOCKERFILE: ${{ matrix.configs.dockerfile }}
STRAT_DOCKER_CONTEXT: ${{ matrix.configs.context }}
STRAT_DOCKER_PLATFORM: ${{ matrix.configs.platform }}
steps:
- uses: actions/checkout@v4
- uses: rlespinasse/[email protected]
- uses: docker/setup-buildx-action@v3
- uses: docker/setup-qemu-action@v3
- name: Build and Push Docker
run: ./scripts/ci/ci-docker.sh
env:
CI_DOCKER_IMAGE: ${{ env.STRAT_DOCKER_IMAGE }}
CI_DOCKER_CONTEXT: ${{ env.STRAT_DOCKER_CONTEXT }}
CI_DOCKERFILE: ${{ env.STRAT_DOCKERFILE }}
CI_DOCKER_PLATFORM: ${{ env.STRAT_DOCKER_PLATFORM }}

DOMAIN: ${{ env.DOCKER_DOMAIN }}

GITHUB_REPO_REF: ${{ github.repository }}
GITHUB_SHA: ${{ github.sha }}
GITHUB_BRANCH: ${{ env.GITHUB_REF_SLUG }}

DOCKER_PASSWORD: ${{ env.DOCKER_PASSWORD }}
DOCKER_USER: ${{ env.DOCKER_USER }}

S3_KEY_ID: ${{ env.DOCKER_CACHE_KEY_ID }}
S3_KEY_SECRET: ${{ env.DOCKER_CACHE_KEY_SECRET }}
S3_URL: ${{ env.DOCKER_CACHE_URL }}
S3_BUCKET: ${{ env.DOCKER_CACHE_BUCKET }}
S3_REGION: ${{ env.DOCKER_CACHE_REGION }}

LATEST_BRANCH: ${{ env.DOCKER_LATEST_BRANCH}}

release:
name: Semantic Release
needs:
- precommit
- build
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: rlespinasse/[email protected]

- name: Release
env:
GITHUB_REPO_REF: ${{ github.repository }}
GITHUB_SHA: ${{ github.sha }}
GITHUB_BRANCH: ${{ env.GITHUB_REF_SLUG_URL }}
CI_DOCKER_IMAGES: "sulfone-boron-amd,sulfone-boron-arm"

GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

DOMAIN: ${{ env.DOCKER_DOMAIN }}

DOCKER_PASSWORD: ${{ env.DOCKER_PASSWORD }}
DOCKER_USER: ${{ env.DOCKER_USER }}

run: nix develop .#releaser -c scripts/ci/release.sh
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.direnv
.pre-commit-config.yaml
6 changes: 6 additions & 0 deletions .gitlint
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[general]
contrib=CT1
ignore=B6

[contrib-title-conventional-commits]
types = amend,build,ci,config,docs,feat,fix,perf,refactor,style,test
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:20

RUN apt-get update && \
apt-get install -y --no-install-recommends default-jre-headless=2:1.17-74 && \
wget --progress=dot:giga -O /usr/local/bin/apktool.jar https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.5.0.jar && \
wget --progress=dot:giga -O /usr/local/bin/apktool https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool && \
chmod +x /usr/local/bin/apktool /usr/local/bin/apktool.jar \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN npm i -g apk-mitm

CMD ["sh", "-c", "sleep infinity"]
17 changes: 17 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# apk-mitm Docker Image

Docker image for `apk-mitm`

# Pre-requisite

- Nix
- Docker
- Direnv

# Get Started

To build and test the image, run

```bash
pls run
```
11 changes: 11 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: "3"

tasks:
build:
desc: Builds Docker image
cmds:
- docker build -t=kirinnee/apk-mitm:{{.CLI_ARGS}} .
run:
desc: Builds and runs the docker image
cmds:
- ./scripts/run.sh {{.CLI_ARGS}}
132 changes: 132 additions & 0 deletions atomi_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
gitlint: .gitlint

conventionMarkdown:
path: CommitConventions.md
template: |
---
id: commit-conventions
title: Commit Conventions
---
var___convention_docs___
keywords:
- BREAKING CHANGE
- BREAKING CHANGES
- BREAKING

branches:
- main

specialScopes:
no-release:
desc: Prevent release from happening
release: false

plugins:
- module: "@semantic-release/changelog"
config:
changelogFile: Changelog.md
- module: "@semantic-release/git"
config:
message: "release: ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
assets:
- Changelog.md
- CommitConventions.md
- module: "@semantic-release/github"

# Angular Conventional Commit Example: https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#-commit-message-guidelines
types:
- type: build
desc: "Changes that affect the build system or external dependencies (example scopes: nix)"
scopes:
default:
desc: Fixes in nix
release: false
- type: config
desc: "Changes to the configuration files (example scopes: nix, ci)"
scopes:
default:
desc: Update configuration files
release: false
- type: ci
desc: "Changes to our CI configuration files and scripts (example scopes: github_workflow, github_action)"
scopes:
default:
desc: Update CI configuration
release: false
- type: docs
section: πŸ“œ Documentation πŸ“œ
desc: Documentation only changes
scopes:
default:
desc: Update documentation such as README file
release: false
- type: feat
section: ✨ Features ✨
desc: A new feature
vae:
verb: add
application: <scope>, <title>
example: "feat: new withdraw api for rapid"
scopes:
default:
desc: Release a new features
release: minor
- type: fix
section: πŸ› Bug Fixes πŸ›
desc: A bug fix
vae:
verb: fix
application: <title>
example: "fix: deposit api for rapid"
scopes:
default:
desc: Generic fixes
release: patch
- type: perf
section: πŸš€ Performance Improvement πŸš€
desc: A code change that improves performance
vae:
verb: improve
application: <title>
example: "perf: alpaca api callback speed increase"
scopes:
default:
desc: Generic improvement statement
release: patch
- type: refactor
desc: A code change that neither fixes a bug nor adds a feature
vae:
verb: refactor
application: <scope>, <title>
example: "refactor: make withdrawal code more reusable"
scopes:
default:
desc: Refactor existing feature
release: minor
- type: style
desc: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
vae:
verb: style
application: <title>
example: "style: add missing semi colon"
scopes:
default:
desc: Generic improvement statement
release: patch
- type: test
section: πŸ§ͺ Tests πŸ§ͺ
desc: Adding missing tests or correcting existing tests
vae:
verb: test
application: <scope>, <title>
example: "test: update test for deposit api"
scopes:
default:
desc: Made changes to test
release: minor
- type: amend
desc: Any amendment, uncategorized, or small mistakes (like typos)
scopes:
default:
desc: amendments
release: false
Loading

0 comments on commit 7e1ab87

Please sign in to comment.