Skip to content

Commit

Permalink
Release v1.0.0 (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
5ouma authored Aug 30, 2024
2 parents 6091a77 + dec4942 commit 5886f8e
Show file tree
Hide file tree
Showing 30 changed files with 599 additions and 414 deletions.
32 changes: 1 addition & 31 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ I would recommend reading this guideline for a better development experience.
<br />

- [💬 Commit Message](#-commit-message)
- [🎋 Pull Requests Branch](#-pull-requests-branch)
- [❓ Pull Requests Title](#-pull-requests-title)
- [🪵 Commit Log](#-commit-log)

Expand All @@ -30,35 +29,6 @@ Body

<br />

## 🎋 Pull Requests Branch

I use the [`dev`] branch for the temporary merging.
When it's time to release, I'll merge the [`dev`] branch into the [`main`] branch.
<br />
For this reason, please fork the [`dev`] branch and open a PR to it.

[`main`]: https://github.com/5ouma/rproxy/tree/main
[`dev`]: https://github.com/5ouma/rproxy/tree/dev

```mermaid
flowchart LR
subgraph PR Branches
feature1
feature2
feature3
end
subgraph Origin Branches
dev
main
end
feature1 & feature2 & feature3 -- Squash Merge --> dev
dev -- Merge --> main
```

<br />

## ❓ Pull Requests Title

You don't need to add any prefixes like `feature` or `bug fix`
Expand All @@ -70,5 +40,5 @@ Please give a clear title.

## 🪵 Commit Log

I do squash merge to the dev branch to keep the commit history clean.
I do squash merge to the main branch to keep the commit history clean.
When merging your Pull Request, I'll add the Conventional Commits type and scope.
2 changes: 0 additions & 2 deletions .github/branch-switcher.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .github/delete-merged-branch-config.yml

This file was deleted.

1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ updates:
directory: /
schedule:
interval: daily
target-branch: dev
labels: []
3 changes: 0 additions & 3 deletions .github/workflows/deps-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,11 @@ jobs:
steps:
- name: 🚚 Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: dev

- name: 🦕 Update Dependencies
uses: hasundue/molt-action@2042116c4f16e14c08c98130f1470c19c5cbfd2f # v1.0.2
with:
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
base: dev
branch: deps-deno
commit-prefix: "chore(deps):"
labels:
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: 🚀 Release

on:
push:
branches:
- main
paths:
- deno.json

permissions:
contents: write
id-token: write

jobs:
Release:
runs-on: Ubuntu-Latest

steps:
- name: 🚚 Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: 📦 Get the Package Version
uses: notiz-dev/github-action-json-property@a5a9c668b16513c737c3e1f8956772c99c73f6e8 # v0.2.0
id: version
with:
path: deno.json
prop_path: version

- name: 🔍 Detect the Version has Changed
id: version-has-changed
run: |
tag="$(git tag -l | sort -V | tail -n 1)"
if [[ "$tag" == "v${{ steps.version.outputs.prop }}" ]]; then
echo "stop=true" | tee -a "$GITHUB_OUTPUT"
fi
- name: 🚀 Rrelease a New Version
if: ${{ steps.version-has-changed.outputs.stop != 'true' }}
run: gh release create "v${{ steps.version.outputs.prop }}" --generate-notes
env:
GH_TOKEN: ${{ github.token }}

- name: ⬆️ Publish to JSR
if: ${{ steps.version-has-changed.outputs.stop != 'true' }}
run: npx jsr publish
6 changes: 4 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
- dev
paths:
- "**.ts"
- deno.lock
Expand All @@ -24,7 +23,7 @@ jobs:
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: 🦕 Setup Deno
uses: denoland/setup-deno@5fae568d37c3b73449009674875529a984555dd1 # v1.3.0
uses: denoland/setup-deno@916edb9a40fd86d1ff57b758807ebe57242f7407 # v1.4.0
with:
deno-version: v1.x

Expand All @@ -34,6 +33,9 @@ jobs:
- name: 🧹 Lint Check
run: deno lint

- name: 📚 Lint the JSDoc
run: deno doc --lint ./src

- name: 📝 Format Check
run: deno fmt --check

Expand Down
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ ci:
chore(fix): Auto fixes from pre-commit.com hooks
For more information, see https://pre-commit.ci.
autoupdate_branch: dev
autoupdate_commit_msg: "chore(deps): Bump pre-commit hook"

repos:
Expand All @@ -23,7 +22,7 @@ repos:
args: [--whitespaces-count, "2"]

- repo: https://github.com/crate-ci/typos
rev: v1.23.6
rev: v1.24.1
hooks:
- id: typos

Expand Down
48 changes: 22 additions & 26 deletions .github/README.md → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
**🚚 Deliver any files in the GitHub repository**

[![GitHub Release](https://img.shields.io/github/v/release/5ouma/reproxy?style=flat-square)](https://github.com/5ouma/reproxy/releases)
[![JSR](https://jsr.io/badges/@5ouma/reproxy?style=flat-square)](https://jsr.io/@5ouma/opmlreproxy)
<br />
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/5ouma/reproxy?style=flat-square)
![GitHub repo size](https://img.shields.io/github/repo-size/5ouma/reproxy?style=flat-square)
[![GitHub last commit](https://img.shields.io/github/last-commit/5ouma/reproxy?style=flat-square)](https://github.com/5ouma/reproxy/commit/HEAD)
[![GitHub commit activity](https://img.shields.io/github/commit-activity/m/5ouma/reproxy?style=flat-square)](https://github.com/5ouma/reproxy/commits/main)
<br />
[![Test](https://img.shields.io/github/actions/workflow/status/5ouma/reproxy/test.yml?label=test&style=flat-square)](https://github.com/5ouma/reproxy/actions/workflows/test.yml)
[![Release](https://img.shields.io/github/actions/workflow/status/5ouma/reproxy/release.yml?label=release&style=flat-square)](https://github.com/5ouma/reproxy/actions/workflows/release.yml)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/5ouma/reproxy/main.svg?style=flat-square)](https://results.pre-commit.ci/latest/github/5ouma/reproxy/main)
[![codecov](https://codecov.io/github/5ouma/reproxy/graph/badge.svg?token=OQB55KXJIL)](https://codecov.io/github/5ouma/reproxy)

Expand All @@ -34,35 +37,30 @@ To do this, simply add the ref name to the sub-directory.

## 🔧 Setup

You can host your file on [Deno Deploy](https://deno.com/deploy).

### 💪 Manual Deployment

1. Clone this repository

```sh
git clone https://github.com/5ouma/reproxy.git
```
### 💻 On Local

2. Copy the [`.env.tmpl`](../.env.tmpl) to `.env` and edit as you prefer
1. Copy the [`.env.tmpl`](./.env.tmpl) to `.env` and edit as you prefer

> [🌍 Environment Variables](#-environment-variables)
3. Install [Deno](https://deno.com) and [deployctl](https://docs.deno.com/deploy/manual/deployctl).

4. Deploy to Deno Deploy
2. Run this command

```sh
deployctl deploy --prod --env-file='.env'
deno run -A jsr:@5ouma/reproxy/serve
```

<br />

### ⚙️ Automatic Deployment
### 🦕 Use [Deno Deploy](https://deno.com/deploy)

1. [Fork this repository](https://github.com/5ouma/reproxy/fork)
1. [Create a new playground](https://dash.deno.com)

2. [Create a new project](https://dash.deno.com/new_project) with your forked repository
2. Replace the default code with this

```ts
import { app } from "jsr:@5ouma/reproxy";
Deno.serve(app.fetch);
```

3. Set the environment variables
(_Don't forget!!_)
Expand All @@ -79,13 +77,11 @@ You can host your file on [Deno Deploy](https://deno.com/deploy).
git clone https://github.com/5ouma/reproxy.git
```

2. Copy the [`.env.template`](../.env.template) to `.env` and edit as you prefer
2. Copy the [`.env.tmpl`](./.env.tmpl) to `.env` and edit as you prefer

> [🌍 Environment Variables](#-environment-variables)
3. Install [Deno](https://deno.com)

4. Run the [`server.ts`](../src/server.ts) via these task runners
3. Run the [`server.ts`](./src/server.ts) via these task runners

```sh
# For production
Expand All @@ -103,10 +99,10 @@ You can host your file on [Deno Deploy](https://deno.com/deploy).

| Name | Required |
| :----------------: | :------: |
| `REPOSITORY_OWNER` | true |
| `REPOSITORY_NAME` | true |
| `REPOSITORY_PATH` | true |
| [`GITHUB_TOKEN`] | false |
| `REPOSITORY_OWNER` | yes |
| `REPOSITORY_NAME` | yes |
| `REPOSITORY_PATH` | yes |
| [`GITHUB_TOKEN`] | no |

> [!NOTE]
> You need to add [`GITHUB_TOKEN`] if you want to:
Expand Down Expand Up @@ -134,5 +130,5 @@ You can host your file on [Deno Deploy](https://deno.com/deploy).

I happily welcome your contributions!
Before you contribute,
I would recommend reading [CONTRIBUTING.md](./CONTRIBUTING.md)
I would recommend reading [CONTRIBUTING.md](./.github/CONTRIBUTING.md)
for a better development experience.
29 changes: 14 additions & 15 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
{
"$schema": "https://deno.land/x/deno/cli/schemas/config-file.v1.json",
"fmt": { "exclude": ["LICENSE", ".github/**/*.md"] },
"name": "@5ouma/reproxy",
"version": "1.0.0",
"exports": { ".": "./src/app.ts", "./serve": "./src/server.ts" },
"publish": {
"include": ["LICENSE", "README.md", "deno.json", "src/"],
"exclude": ["**/*.test.ts", "src/libs/test_utils.ts"]
},
"fmt": { "exclude": ["LICENSE", "README.md", ".github/**/*.md"] },
"tasks": {
"run": "deno run --env='.env' --allow-env='REPOSITORY_OWNER,REPOSITORY_NAME,REPOSITORY_PATH,GITHUB_TOKEN' --allow-net='0.0.0.0,api.github.com'",
"start": "deno task run ./src/server.ts",
"dev": "deno task run --watch ./src/server.ts",
"test": "deno test --allow-env='REPOSITORY_OWNER,REPOSITORY_NAME,REPOSITORY_PATH,GITHUB_TOKEN' --allow-net='api.github.com' --parallel --shuffle",
"start": "deno task run src/server.ts",
"dev": "deno task run --watch src/server.ts",
"test": "deno test --allow-env='REPOSITORY_OWNER,REPOSITORY_NAME,REPOSITORY_PATH,GITHUB_TOKEN' --allow-net='0.0.0.0,api.github.com' --parallel --shuffle",
"cov": "deno task test --coverage && deno coverage --lcov > coverage.lcov"
},
"imports": {
"@oak/oak": "jsr:@oak/[email protected]",
"@octokit/rest": "https://esm.sh/@octokit/[email protected]",
"@hono/hono": "jsr:@hono/[email protected]",
"@std/assert": "jsr:@std/[email protected]",
"@std/fmt": "jsr:@std/[email protected]",
"@std/http": "jsr:@std/[email protected]",
"@std/http/user-agent": "jsr:@std/http@~0.223/user-agent",
"@std/path": "jsr:@std/[email protected]"
},
"deploy": {
"project": "reproxy",
"include": ["./deno.json", "./src/"],
"entrypoint": "./src/server.ts"
"@std/path": "jsr:@std/[email protected]",
"@octokit/rest": "npm:@octokit/[email protected]"
}
}
Loading

0 comments on commit 5886f8e

Please sign in to comment.