Skip to content

Commit

Permalink
feat: builder
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelass committed Feb 17, 2024
1 parent c253b17 commit 1b5cfc0
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,21 @@ jobs:
outputs:
version: ${{ steps.package_version.outputs.version }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: "18"
- name: Install dependencies
run: npm install
- name: Run start script
run: npm run start
- name: Get version from package.json
id: package_version
run: echo "::set-output name=version::$(jq -r '.version' package.json)"
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: index
path: index.json

check-release:
needs: build
runs-on: ubuntu-latest
outputs:
exists: ${{ steps.check_release.outputs.exists }}
steps:
- uses: actions/checkout@v2
- 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]
runs-on: ubuntu-latest
Expand All @@ -56,5 +36,3 @@ jobs:
uses: softprops/action-gh-release@v1
with:
files: index.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 1b5cfc0

Please sign in to comment.