TypeScript Action with Deno template inspire by actions/typescript-action.
This template includes compilation TypeScript(deno) to JavaScript support, tests, a validation workflow, publishing, and versioning guidance.
To create your own action, you can use this repository as a template! Just follow the below instructions:
- Click the Use this template button at the top of the repository
- Select Create a new repository
- Select an owner and name for your new repository
- Click Create repository
- Clone your new repository
You'll need to install Deno and Node.js to develop your action.
After git clone
this repository, you'll need to perform some initial setup steps before you can develop your action.
# Setup githooks that check dist/ before git push
deno task setup:githooks
When you copy this repository, update action.yml
with the name, description, author, inputs, and outputs for your action.
The src/
directory contains the entrypoint scripts and libraries. main.ts
and post.ts
are the entrypoints that will be executed when your action is invoked, others are library code. The tests/
directory contains test code.
You can run tests with deno test -A
command, or you can run deno task dev
to run tests automatically when you change codes.
After changing src/
or some dependencies, you need to run deno task bundle
to bundle your code into dist/
directory. Since GitHub Actions requires JavaScript, deno task bundle
will compile deno TypeScript to JavaScript using dnt and then bundle it with dependencies using esbuild.
Finally, you need to commit dist/
directory and push it to GitHub.
You can validate format, lint, test, and bundle with GitHub Actions. See ci.yml for details.
After editing codes, you can publish your action to GitHub Releases.
When you push to 'main' branch release-drafter
will automatically make the draft release and also the changelog by pull-requests label. You can change pull-requests category in the changelog by editing the pull-request label directly if you want.
When it is time to publish new version, you can do it by dispatch relese.yml from GitHub. release-drafter
will choose the next version by semantic versioning then tag and publish Github Releases.
See release.yml and release-drafter.yml for details.