From 1d9bedb966229544c65f642aca1d8e3c869ebcc5 Mon Sep 17 00:00:00 2001 From: pixelass Date: Sun, 18 Feb 2024 00:58:53 +0100 Subject: [PATCH] feat: builder --- .github/workflows/release.yml | 25 +++++++++++++++++++++++-- package.json | 2 +- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5c928a7..e516d75 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,12 +29,33 @@ jobs: name: index path: index.json + check-release: + needs: build + runs-on: ubuntu-latest + outputs: + exists: ${{ steps.check_release.outputs.exists }} + steps: + - uses: actions/checkout@v4 + - name: Check if release already exists + id: check_release + run: | + RELEASE_URL=$(curl -sH "Authorization: token ${{secrets.GITHUB_TOKEN}}" https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ needs.build.outputs.version }}) + if [[ "$RELEASE_URL" == *"\"url\": \"*"* ]]; then + echo "::set-output name=exists::true" + else + echo "::set-output name=exists::false" + fi + release: - needs: [build] + needs: check-release + if: needs.check-release.outputs.exists == 'false' runs-on: ubuntu-latest - if: needs.build.outputs.version != '' steps: - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: index + path: . - name: Create Release and Upload Assets uses: softprops/action-gh-release@v1 with: diff --git a/package.json b/package.json index e8e2051..4b6479a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "captain-marketplace", - "version": "1.0.0-alpha.1", + "version": "1.0.0-alpha.2", "description": "", "main": "index.js", "type": "module",