diff --git a/.github/workflows/bundle-release.yml b/.github/workflows/bundle-release.yml new file mode 100644 index 0000000..7d4157a --- /dev/null +++ b/.github/workflows/bundle-release.yml @@ -0,0 +1,38 @@ +name: Bundle +on: + release: + types: ['created'] +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Get release + id: get_release + uses: bruceadams/get-release@v1.2.0 + env: + GITHUB_TOKEN: ${{ github.token }} + - name: Checkout + uses: actions/checkout@v2 + - name: Setup node + uses: actions/setup-node@v1 + with: + node-version: '14' + - name: Build + run: | + npm ci + npm run build + - name: Get plugin name + id: plugin_name + uses: notiz-dev/github-action-json-property@release + with: + path: 'package.json' + prop_path: 'name' + - name: Upload Release Bundle + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_path: ./dist/js/plugins/${{ steps.plugin_name.outputs.prop }}.js + asset_name: ${{ steps.plugin_name.outputs.prop }}.js + asset_content_type: application/javascript \ No newline at end of file