JasonEtco / github-action-auto-compile-node

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auto Compile Node

This action will take any Node.js action, compile and package it in to a single file so that it can be executed using the node12 runtime in GitHub Actions.

It is intended to be triggered when a release is published, and will update the tag of the release when it finishes running.

The action:

  • Runs npm install
  • Compiles the code using ncc
  • Rewrites action.yml, setting the runtime to node12 and the main entry to index.dist.js
  • Commits these changes and updates the tag to point at the new commit

At this point, any consumers may point at the tag and their actions will run much faster than pointing at master

Usage

name: Auto-Compile
on: 
  release:
    types: [published]
jobs:
  compile:
    runs-on: ubuntu-16.04
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Automatically build action
        uses: mheap/github-action-auto-compile-node@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Caveats

At the moment, the action only supports actions with an entrypoint of index.js.

About


Languages

Language:JavaScript 67.4%Language:Dockerfile 32.6%