39 lines
No EOL
1.1 KiB
YAML
39 lines
No EOL
1.1 KiB
YAML
name: Build Distribution Files
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
# Only run the build on Adafruit's repository. It makes the PRs less messy.
|
|
if: startswith(github.repository, 'adafruit/')
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: true
|
|
- name: Create dist Folder
|
|
run: "mkdir -p dist"
|
|
- name: Remove existing dist files
|
|
run: "rm -f dist/*"
|
|
- name: Copy files to dist folder
|
|
run: "cp *.{js,py,json} dist/"
|
|
- name: Minify JavaScript
|
|
uses: nizarmah/auto-minify@v2.1
|
|
with:
|
|
directory: 'dist'
|
|
js_engine: 'uglify-js'
|
|
- name: Update Minified Dependencies
|
|
run: "sed -i 's/base_installer\\.js/base_installer.min.js/g' dist/*.min.js"
|
|
- name: Commit Distribution Files
|
|
uses: stefanzweifel/git-auto-commit-action@v4
|
|
with:
|
|
repository: 'dist'
|
|
commit_message: "Github Action: Updated dist files"
|
|
branch: ${{ github.ref }} |