Build dist files and release #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build dist files and release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
type: string | |
description: Version for new release | |
required: true | |
default: 0.0.0 | |
jobs: | |
build: | |
name: Build dist files and release | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "20.11.1" | |
- name: Install dependencies | |
run: npm clean-install | |
- name: Install ncc | |
run: npm --location=global install @vercel/ncc | |
- name: Generate unified release files with ncc | |
run: | | |
ncc build src/terraform.js -o dist/terraform -m | |
ncc build src/wrapper.js -o dist/wrapper -m | |
- name: Add dist-files to last commit | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Github Action" | |
git add dist/* | |
git update-index --chmod=+x dist/wrapper/index.js | |
git commit -m "Auto-build dist files" --allow-empty | |
git push -f | |
- name: Release | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release create v${{ github.event.inputs.version }} --generate-notes |