Skip to content

Commit 05ee385

Browse files
Initialize
0 parents  commit 05ee385

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+4436
-0
lines changed

.github/workflows/publish.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Publish NPM package
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write # needed to create releases
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v2
21+
with:
22+
node-version: "20"
23+
registry-url: "https://registry.npmjs.org"
24+
25+
- name: Install dependencies
26+
run: npm install
27+
28+
# - name: Test
29+
# run: npm test
30+
31+
- name: Check the version
32+
id: check
33+
run: |
34+
CURRENT_VERSION=$(jq -r .version package.json)
35+
echo "Current version: $CURRENT_VERSION"
36+
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
37+
echo "Latest tag: $LATEST_TAG"
38+
39+
LATEST_VERSION=${LATEST_TAG#v}
40+
41+
if [ "$LATEST_VERSION" = "$CURRENT_VERSION" ];
42+
then
43+
echo "Version is equal"
44+
echo "version_equal=true" >> $GITHUB_OUTPUT
45+
echo "new_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
46+
else
47+
echo "Version is not equal"
48+
echo "version_equal=false" >> $GITHUB_OUTPUT
49+
fi
50+
51+
- name: Build
52+
run: npm run build
53+
if: steps.check.outputs.version_equal == 'true'
54+
55+
- name: Publish
56+
if: steps.check.outputs.version_equal == 'true'
57+
run: npm publish --access public --no-git-checks
58+
env:
59+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
60+
61+
# - name: Git Info Update
62+
# if: steps.check.outputs.version_equal == 'true'
63+
# run: |
64+
# git config --local user.email "github-actions[bot]@users.noreply.github.com"
65+
# git config --local user.name "github-actions[bot]"
66+
67+
- name: Install GitHub CLI
68+
run: sudo apt-get install gh -y
69+
70+
- name: Create GitHub release
71+
if: steps.check.outputs.version_equal == 'true'
72+
run: |
73+
gh release create "v${{ steps.check.outputs.new_version }}" \
74+
./index.js \
75+
./templates \
76+
./package.json \
77+
--title "v${{ steps.check.outputs.new_version }}"
78+
env:
79+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package-lock.json
2+
tsconfig.tsbuildinfo
3+
index.js
4+
node_modules

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
index.ts

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Initialize discord.https Project
2+
3+
## Install:
4+
5+
```bash
6+
npm create discord-https@latest
7+
```
8+
9+
Then follow the prompts to initialize your Discord.https project.
10+
11+
## Currently Supported Server Environments
12+
13+
- NodeJS(persistent)
14+
- Vercel Serverless
15+
- Cloudflare Worker

0 commit comments

Comments
 (0)