# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions name: Build release assets on: push: branches: [main] workflow_dispatch: jobs: build: environment: production runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Write .env to build env: DOTENV: '${{ secrets.DOTENV }}' run: echo "$DOTENV" >> .env - name: Use Node.js 16.x uses: actions/setup-node@v2 with: node-version: 16.x - name: Install dependencies and build run: npm run dist - uses: release-drafter/release-drafter@v5 id: release-draft env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload Release Asset id: upload-release-asset uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.release-draft.outputs.upload_url }} asset_path: ./dist.tar.gz asset_name: dist.tar.gz asset_content_type: application/gzip