name: build on: release: types: [created] jobs: build: environment: automated-release runs-on: ubuntu-latest env: GH_TOKEN: ${{secrets.GH_TOKEN}} steps: - uses: actions/checkout@v2 - name: Add config details run: | git config --global user.name ${{secrets.NAME}} git config --global user.email ${{secrets.EMAIL}} - name: Move release to draft run: gh release edit $TAG_NAME --draft=true env: TAG_NAME: ${{ github.event.release.tag_name }} - name: Run npm install, build and test run: | npm i npm run build npm run test npm run lint - run: zip -r release.zip lib LICENSE package-lock.json package.json *.md -x 'lib/src/*' 'lib/test/*' - name: Upload production artifacts run: | gh release upload $TAG_NAME "release.zip#release" gh release edit $TAG_NAME --draft=false env: TAG_NAME: ${{ github.event.release.tag_name }}