Skip to content

Commit

Permalink
chore: prepare the repo for a stable release (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
KnorpelSenf authored Nov 13, 2024
1 parent d97283a commit 3904059
Show file tree
Hide file tree
Showing 11 changed files with 118 additions and 299 deletions.
106 changes: 57 additions & 49 deletions .github/workflows/deno.yml
Original file line number Diff line number Diff line change
@@ -1,71 +1,79 @@
name: ci

on:
push:
branches:
- main
- next
pull_request:
branches:
- main
- next
push:
branches:
- main
- next
pull_request:
branches:
- main
- next

jobs:
backport:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
backport:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: denoland/setup-deno@v1
- uses: denoland/setup-deno@v2
with:
deno-version: 2.x

- run: npm install --ignore-scripts
- run: npm install --ignore-scripts

- run: npm run backport
- run: npm run backport

fmt-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fmt-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: denoland/setup-deno@v1
- uses: denoland/setup-deno@v2
with:
deno-version: 2.x

- run: deno fmt --check
- run: deno fmt --check

- run: deno lint
- run: deno lint

test:
runs-on: ${{ matrix.os }} # runs a test on Ubuntu, Windows and macOS
test:
runs-on: ${{ matrix.os }} # runs a test on Ubuntu, Windows and macOS

strategy:
matrix:
os: [macOS-latest, windows-latest, ubuntu-latest]
strategy:
matrix:
os: [macOS-latest, windows-latest, ubuntu-latest]

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: denoland/setup-deno@v1
- uses: denoland/setup-deno@v2
with:
deno-version: 2.x

- run: deno cache src/mod.ts
- run: deno cache -I src/mod.ts

- run: deno task test
- run: deno task test

coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: denoland/setup-deno@v1
- uses: denoland/setup-deno@v2
with:
deno-version: 2.x

- run: deno task coverage
- run: deno task coverage

- uses: codecov/codecov-action@v1.0.10 # upload the report on Codecov
with:
file: ./coverage.lcov
- uses: codecov/codecov-action@v1.0.10 # upload the report on Codecov
with:
file: ./coverage.lcov
49 changes: 26 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
name: Release

on:
push:
tags:
- "**"
push:
tags:
- "**"

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: denoland/setup-deno@v1
- run: npm install
- uses: denoland/setup-deno@v2
with:
deno-version: 2.x

- name: Publish to npm
run: |
npm config set //registry.npmjs.org/:_authToken '${NPM_TOKEN}'
npm publish --ignore-scripts
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npm install

- name: Create Release
uses: softprops/action-gh-release@v1
env:
HOOK: 0
with:
generate_release_notes: true
- name: Publish to npm
run: |
npm config set //registry.npmjs.org/:_authToken '${NPM_TOKEN}'
npm publish --ignore-scripts
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create Release
uses: softprops/action-gh-release@v1
env:
HOOK: 0
with:
generate_release_notes: true
1 change: 0 additions & 1 deletion .tool-versions

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) [year] [fullname]
Copyright (c) 2024 Rogerio Munhoz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## grammY Commands Plugin
# grammY commands

This plugin provides a convenient way to define and manage commands for your grammY bot. It simplifies the process of
setting up commands with scopes and localization.
This plugin provides a convenient way to define and manage commands for your grammY bot.
It simplifies the process of setting up commands with scopes and localization.

## Installation

Expand All @@ -14,7 +14,7 @@ npm i @grammyjs/commands
The main functionality of this plugin is to define your commands, localize them, and give them handlers for each
[scope](https://core.telegram.org/bots/api#botcommandscope), like so:

```typescript
```ts
import { Bot } from "grammy";
import { CommandGroup } from "@grammyjs/commands";

Expand Down Expand Up @@ -50,7 +50,7 @@ will not be registered, and your bot will not respond to those commands.
This plugin provides a shortcut for setting the commands for the current chat. To use it, you need to install the
commands flavor and the plugin itself, like so:

```typescript
```ts
import { Bot, Context } from "grammy";
import { CommandGroup, commands, CommandsFlavor } from "@grammyjs/commands";

Expand Down
2 changes: 1 addition & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"backport": "rm -rf out && deno run --no-prompt --allow-read=. --allow-write=. https://deno.land/x/deno2node@v1.9.0/src/cli.ts",
"check": "deno lint && deno fmt --check && deno check src/mod.ts",
"fix": "deno lint --fix && deno fmt",
"test": "deno test --seed=123456 --parallel ./test/",
"test": "deno test --allow-import --seed=123456 --parallel ./test/",
"coverage": "rm -rf ./test/cov_profile && deno task test --coverage=./test/cov_profile && deno coverage --lcov --output=./coverage.lcov ./test/cov_profile",
"hook": "deno run --allow-read --allow-run --allow-write https://deno.land/x/deno_hooks@0.1.1/mod.ts"
},
Expand Down
Loading

0 comments on commit 3904059

Please sign in to comment.