From 5fd71e1cd7df33ec7ce2842a223caba824dd2de9 Mon Sep 17 00:00:00 2001 From: Ryan Meek <25127328+maykar@users.noreply.github.com> Date: Thu, 5 Nov 2020 21:54:47 -0500 Subject: [PATCH] Create build.yml --- .github/workflows/build.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..965444d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,23 @@ +name: Build on release + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: npm install uglify-js @babel/core @babel/cli @babel/preset-env + - run: npx babel swipe-navigation.js --out-file swipe-navigation.js --presets @babel/preset-env + - run: npx uglify-js swipe-navigation.js -b beautify=false,max_line_len=150 --compress --mangle toplevel --output swipe-navigation.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: ./swipe-navigation.js + asset_name: swipe-navigation.js + asset_content_type: text/javascript