diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01d7b95..48ebbae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,6 +84,34 @@ jobs: labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max + build-and-upload-release: + name: Build and Upload build to Github Release + runs-on: ubuntu-latest + needs: + - test-and-build + - e2e-test + if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '18' + - name: Install dependencies + run: npm install + - name: Build project + run: npm run build + - name: Create archives + run: | + tar -cvzf release.tar.gz -C dist $(ls dist) + - name: Upload Binaries to Release + if: startsWith(github.ref, 'refs/tags/v') + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ github.ref_name }} + file: release.tar.gz deploy: if: github.ref == 'refs/heads/main' needs: