addd steps #30
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 and Release Electron App | |
on: | |
push: | |
branches: | |
- main # This triggers the workflow on pushes to the main branch | |
permissions: | |
contents: write # This is necessary for creating releases and uploading release assets | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "20" | |
- name: Install dependencies | |
run: yarn install | |
- name: Build Electron app | |
run: yarn build:linux | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: electron-app | |
path: dist/*.deb | |
release: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: electron-app | |
path: ./dist | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: release-${{ github.run_id }} | |
release_name: Release for ${{ github.run_id }} | |
draft: false | |
prerelease: false | |
- 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: ./dist/*.deb | |
asset_name: "orkestrator-${{ github.run_id }}.deb" | |
asset_content_type: application/vnd.debian.binary-package |