Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsRiprod committed Jul 14, 2024
1 parent 19054bd commit 6d19d21
Showing 1 changed file with 32 additions and 24 deletions.
56 changes: 32 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,6 @@ jobs:
cd ./DeskThingServer
npm run typecheck
- name: Install snapcraft on Linux
if: runner.os == 'Linux'
run: |
sudo snap install snapcraft --classic
- name: Build the project
run: |
cd ./DeskThingServer
npm run build
- name: Build application for Windows
if: runner.os == 'Windows'
run: |
Expand All @@ -61,32 +51,30 @@ jobs:
cd ./DeskThingServer
npm run build:linux
- name: Extract version from tag
id: get_version
run: echo "::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}"

- name: Upload artifact for Windows
if: runner.os == 'Windows'
uses: actions/upload-artifact@v3
with:
name: DeskThing-windows-latest # Artifact name for Windows
path: |
./DeskThingServer/dist/*
!./DeskThingServer/dist/**/*.map
name: DeskThing-${{ steps.get_version.outputs.VERSION }}-windows-setup.exe
path: ./DeskThingServer/dist/*.exe

- name: Upload artifact for macOS
if: runner.os == 'macOS'
uses: actions/upload-artifact@v3
with:
name: DeskThing-macos-latest # Artifact name for macOS
path: |
./DeskThingServer/dist/*
!./DeskThingServer/dist/**/*.map
name: DeskThing-${{ steps.get_version.outputs.VERSION }}-mac-setup.dmg
path: ./DeskThingServer/dist/*.dmg

- name: Upload artifact for Linux
if: runner.os == 'Linux'
uses: actions/upload-artifact@v3
with:
name: DeskThing-ubuntu-latest # Artifact name for Linux
path: |
./DeskThingServer/dist/*
!./DeskThingServer/dist/**/*.map
name: DeskThing-${{ steps.get_version.outputs.VERSION }}-linux.AppImage
path: ./DeskThingServer/dist/*.AppImage

release:
needs: build # Runs after build job
Expand All @@ -109,12 +97,32 @@ jobs:
name: DeskThing-windows-latest
path: ./dist/windows

- name: Create Release
- name: Check for existing release
id: release_check
run: |
TAG_NAME=$(git describe --tags --exact-match ${{ github.sha }})
echo "::set-output name=tag_name::${TAG_NAME}"
- name: Create or update release
if: steps.release_check.outputs.tag_name != ''
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.release_check.outputs.tag_name }}
files: |
./dist/ubuntu/*
./dist/macos/*
./dist/windows/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create new release if no existing release found
if: steps.release_check.outputs.tag_name == ''
uses: softprops/action-gh-release@v1
with:
files: |
./dist/ubuntu/*
./dist/macos/*
./dist/windows/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 6d19d21

Please sign in to comment.