Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
Improve for release
Browse files Browse the repository at this point in the history
  • Loading branch information
KTibow authored Nov 3, 2020
1 parent ff0b1e2 commit 52b08b8
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Build on release

on:
release:
Expand All @@ -9,22 +9,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- run: npm install uglify-js @babel/core @babel/cli @babel/preset-env
- run: |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "GitHub Actions"
git pull
mkdir -p dist
touch dist/kiosk-mode.js
- run: npx babel kiosk-mode.js --out-file kiosk-mode.js --presets @babel/preset-env
- run: npx uglify-js kiosk-mode.js -b beautify=false,max_line_len=150 --compress --mangle toplevel --output dist/kiosk-mode.js
- run: |
git add dist/kiosk-mode.js
git commit --amend --no-edit || true
git push --force || true
- run: npx uglify-js kiosk-mode.js -b beautify=false,max_line_len=150 --compress --mangle toplevel --output kiosk-mode.js
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./kiosk-mode.js
asset_name: kiosk-mode.js
asset_content_type: text/javascript

0 comments on commit 52b08b8

Please sign in to comment.