diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..daf1171 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,61 @@ +name: Github Releases + +on: + push: + tags: + - "v*" + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Clone repository + uses: actions/checkout@v2 + - name: Use Node.js 16.x + uses: actions/setup-node@v1 + with: + node-version: 16.x + - name: Install dependencies + run: yarn install + # - name: Test + # run: npm test + # env: + # CI: true + - name: Generate build + run: yarn run build + # Share artifact inside workflow + - name: Share artifact inside workflow + uses: actions/upload-artifact@v2 + with: + name: react-github-actions-build + path: dist/ + release: + runs-on: ubuntu-latest + # We specify that deploys needs to + # finish before we create a release + needs: build + steps: + # Download previously shared build + - name: Get artifact + uses: actions/download-artifact@v2 + with: + name: react-github-actions-build + # Zip the build using external action + - name: Zip build + uses: thedoctor0/zip-release@master + with: + filename: release + run: zip -r release.zip . -i react-github-actions-build + # Upload as an artifact of the current workflow + - name: Upload build zip artifact + uses: actions/upload-artifact@v1 + with: + name: release + path: release.zip + - name: Create GitHub Release + uses: ncipollo/release-action@v1 + with: + artifacts: release.zip + token: ${{ secrets.TOKEN }} + # Make official GitHub release which will trigger + # sending the mail with link for accesss