Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jmordica committed Dec 26, 2022
0 parents commit 4ae4982
Show file tree
Hide file tree
Showing 15 changed files with 1,386 additions and 0 deletions.
98 changes: 98 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: ci

on:
workflow_dispatch:
push:
branches:
- 'main'
tags:
- 'v*'
pull_request:
branches:
- 'main'

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: voxo/nqlite
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
username: ${{ github.actor }}
password: ${{ secrets.DOCKER_PAT }}

- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: true
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
- uses: denoland/setup-deno@v1.1.1
with:
deno-version: v1.x
- name: Generate the artifacts
if: startsWith(github.ref, 'refs/tags/v')
run: |
VERSION=${GITHUB_REF_NAME#v}
deno compile --target=x86_64-unknown-linux-gnu --output nqlite-$VERSION-linux-amd64/nqlite -A --unstable main.ts
deno compile --target=x86_64-apple-darwin --output nqlite-$VERSION-darwin-amd64/nqlite -A --unstable main.ts
deno compile --target=aarch64-apple-darwin --output nqlite-$VERSION-darwin-arm64/nqlite -A --unstable main.ts
mkdir bin
tar -czf bin/nqlite-$VERSION-linux-amd64.tar.gz nqlite-$VERSION-linux-amd64/nqlite
tar -czf bin/nqlite-$VERSION-darwin-amd64.tar.gz nqlite-$VERSION-darwin-amd64/nqlite
tar -czf bin/nqlite-$VERSION-darwin-arm64.tar.gz nqlite-$VERSION-darwin-arm64/nqlite
- name: Upload the artifacts
uses: svenstaro/upload-release-action@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
repo_token: ${{ secrets.CR_PAT }}
file: bin/*
tag: ${{ github.ref_name }}
overwrite: true
file_glob: true
- name: Release to homebrew
uses: Justintime50/homebrew-releaser@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
homebrew_owner: ${{ github.repository_owner }}
homebrew_tap: homebrew-apps
formula_folder: formula
github_token: ${{ secrets.CR_PAT }}
commit_owner: homebrew-releaser
commit_email: homebrew-releaser@example.com

# Custom install command for your formula.
# Required - string.
install: 'bin.install "nqlite"'
target_darwin_amd64: true
target_darwin_arm64: true
target_linux_amd64: true
target_linux_arm64: false
update_readme_table: true
skip_commit: false
debug: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.data
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"deno.enable": true,
"deno.lint": true,
"deno.unstable": true
}
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM denoland/deno:alpine

EXPOSE 4001

WORKDIR /app

ADD . .

RUN deno cache main.ts

# Pre-download the sqlite module
RUN deno run -A --unstable build-lib.ts

ENTRYPOINT ["deno", "run", "-A", "--unstable", "main.ts"]
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 VOXO

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 4ae4982

Please sign in to comment.