Build: Desktop #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Build: Desktop" | |
on: | |
workflow_dispatch: | |
workflow_call: | |
inputs: | |
semver: | |
required: true | |
type: string | |
push: | |
branches: [ "main" ] | |
paths: [ "desktopApp", "frontend" ] | |
pull_request: | |
branches: [ "main" ] | |
paths: [ "desktopApp", "frontend" ] | |
jobs: | |
build-desktop: | |
permissions: write-all | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- name: Set up frontend dependencies | |
run: | | |
cd frontend | |
npm install | |
npm run build | |
- name: Install dependencies | |
run: | | |
cd desktopApp | |
npm install | |
- name: Build for macOS | |
run: | | |
cd desktopApp | |
npm run package-mac | |
- name: Build for Windows | |
run: | | |
cd desktopApp | |
npm run package-win | |
- name: Build for Linux | |
run: | | |
cd desktopApp | |
npm run package-linux | |
- name: 'Get Commit Hash' | |
id: commit | |
uses: pr-mpt/actions-commit-hash@v3 | |
- name: 'Upload mac-build Release Artifact (for Release)' | |
uses: actions/upload-artifact@v4 | |
if: inputs.semver != '' # only if this workflow is called from a push to tag (a Release) | |
with: | |
name: robosats-desktop-${{ inputs.semver }}-mac-darwin-x64.zip | |
path: desktopApp/release-builds/Robosats-darwin-x64 | |
- name: 'Upload linux-build Release Artifact (for Release)' | |
uses: actions/upload-artifact@v4 | |
if: inputs.semver != '' # only if this workflow is called from a push to tag (a Release) | |
with: | |
name: robosats-desktop-${{ inputs.semver }}-linux.zip | |
path: desktopApp/release-builds/desktopApp-linux.zip | |
- name: 'Upload win-build Release Artifact (for Release)' | |
uses: actions/upload-artifact@v4 | |
if: inputs.semver != '' # only if this workflow is called from a push to tag (a Release) | |
with: | |
name: robosats-desktop-${{ inputs.semver }}-win.zip | |
path: desktopApp/release-builds/desktopApp-win.zip | |
- name: Create Pre-release | |
id: create_release | |
if: inputs.semver == '' # only if this workflow is not called from a push to tag (a Release) | |
uses: ncipollo/[email protected] | |
with: | |
tag: desktop-${{ steps.commit.outputs.short }} | |
name: robosats-desktop-${{ steps.commit.outputs.short }} | |
prerelease: true | |
- name: Upload macOS Build Artifact | |
id: upload-release-mac-zip-asset | |
if: inputs.semver == '' # only if this workflow is not called from a push to tag (a Release) | |
uses: actions/upload-artifact@v4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
path: /desktopApp-mac.zip | |
name: robosats-desktop-${{ steps.commit.outputs.short }}-mac.zip | |
- name: Upload Windows Build Artifact | |
id: upload-release-win-zip-asset | |
if: inputs.semver == '' # only if this workflow is not called from a push to tag (a Release) | |
uses: actions/upload-artifact@v4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
path: desktopApp/release-builds/Robosats-win32-ia32 | |
name: robosats-desktop-${{ steps.commit.outputs.short }}-win32-ia32.zip | |
- name: Upload Linux Build Artifact | |
id: upload-release-linux-zip-asset | |
if: inputs.semver == '' # only if this workflow is not called from a push to tag (a Release) | |
uses: actions/upload-artifact@v4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
path: desktopApp/release-builds/Robosats-linux-x64 | |
name: robosats-desktop-${{ steps.commit.outputs.short }}-linux-x64.zip |