Skip to content

Commit

Permalink
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 2 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/dnt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: dnt

on:
push:
branches: [main]

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: main

- uses: denoland/setup-deno@v1
with:
deno-version: canary

- name: Run build script
run: deno task dnt $GITHUB_SHA

- name: Checkout new branch for npm/ content
run: |
git checkout -B npm || git checkout npm
git rm -rf .
cp -r npm/* .
rm -rf npm
git config --global user.email "[email protected]"
git config --global user.name "LC-Dailies Bot"
git add .
git commit -m "Publish npm ✨"
- name: Push new branch to remote
run: |
# Replace with the appropriate remote repository URL
# Example: git push --force origin npm
git push --force -u origin npm
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.env
ngrok.exe
.denoflare
npm
5 changes: 3 additions & 2 deletions deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
"test": "deno test --unstable",
"start": "deno run -A --unstable main.ts",
"ngrok": "ngrok http 8080",
"cf:push": "deno run -A cf/dailies/push/main.ts",
"cf:serve": "deno run -A cf/dailies/serve/main.ts"
"cf:push": "deno run -A tasks/cf/dailies/push/main.ts",
"cf:serve": "deno run -A tasks/cf/dailies/serve/main.ts",
"dnt": "deno run -A tasks/dnt/main.ts"
},
"imports": {
"lc-dailies/": "./"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
34 changes: 34 additions & 0 deletions tasks/dnt/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Run:
// deno run -A tasks/dnt/main.ts $VERSION

import { build, emptyDir } from "https://deno.land/x/[email protected]/mod.ts";

await emptyDir("./npm");

await build({
entryPoints: [
"./api/types.ts",
],
outDir: "./npm",
test: false,
// see JS docs for overview and more options
shims: { deno: true },
package: {
// package.json properties
name: "lc-dailies",
version: Deno.args[0],
description: "LC-Dailies utility module.",
license: "MIT",
repository: {
type: "git",
url: "git+https://github.com/acmcsufoss/lc-dailies.git",
},
bugs: {
url: "https://github.com/acmcsufoss/lc-dailies/issues",
},
},
});

// post build steps
Deno.copyFileSync("LICENSE", "npm/LICENSE");
Deno.copyFileSync("README.md", "npm/README.md");

0 comments on commit f7d4366

Please sign in to comment.