From 7457ed7d003b0660fd9492fa99b67b25e8a66699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Deniz=20KIVRAK?= Date: Sun, 22 Dec 2024 14:42:37 +0200 Subject: [PATCH] Update publish-release.yml --- .github/workflows/publish-release.yml | 47 +++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 37ef0d8..7013723 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -12,12 +12,32 @@ permissions: pull-requests: write jobs: - publish: + build: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v2 + + - name: Build project + run: | + npm ci + npm run build + + - name: Zip bundle + run: | + zip -r ./${{ github.sha }}.zip . + + - name: Archive artifact + uses: actions/upload-artifact@v3 + with: + name: zipped-bundle + path: ${{ github.sha }}.zip + publish: + runs-on: ubuntu-latest + needs: [build] + steps: + - name: Get version from package.json id: get_version run: | @@ -25,12 +45,33 @@ jobs: echo "VERSION=$VERSION" >> $GITHUB_ENV - name: Create release + id: create_release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.github_token }} with: tag_name: ${{ env.VERSION }} release_name: Release ${{ env.VERSION }} - body: New release for commit ${{ github.sha }}. Release notes on the documentation site - draft: false + body: New release for commit ${{ github.sha }}. + draft: true prerelease: true + + - name: Download artifact + uses: actions/download-artifact@v3 + with: + name: zipped-bundle + + - name: Upload release asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.github_token }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./${{ github.sha }}.zip + asset_name: source_code_with_libraries.zip + asset_content_type: application/zip + + + + +