Files
rmtPocketWatcher/.gitea/workflows/release.yml
2025-12-03 22:16:44 -05:00

107 lines
2.6 KiB
YAML

name: Build and Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build-windows:
runs-on: windows-latest
env:
WS_URL: ${{ secrets.WS_URL }}
API_URL: ${{ secrets.API_URL }}
NODE_ENV: production
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install electron-app dependencies
working-directory: electron-app
run: npm install --ignore-scripts
- name: Install TypeScript globally
run: npm install -g typescript
- name: Build and package for Windows
working-directory: electron-app
run: npm run electron:build -- --win
- name: Upload Windows artifacts
uses: actions/upload-artifact@v4
with:
name: windows-build
path: electron-app/release/*.exe
retention-days: 7
build-linux:
runs-on: ubuntu-latest
env:
WS_URL: ${{ secrets.WS_URL }}
API_URL: ${{ secrets.API_URL }}
NODE_ENV: production
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install electron-app dependencies
working-directory: electron-app
run: npm install --ignore-scripts
- name: Install TypeScript globally
run: npm install -g typescript
- name: Build and package for Linux
working-directory: electron-app
run: npm run electron:build -- --linux
- name: Upload Linux AppImage
uses: actions/upload-artifact@v4
with:
name: linux-appimage
path: electron-app/release/*.AppImage
retention-days: 7
- name: Upload Linux deb
uses: actions/upload-artifact@v4
with:
name: linux-deb
path: electron-app/release/*.deb
retention-days: 7
create-release:
needs: [build-windows, build-linux]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
- name: Display structure of downloaded files
run: ls -R ./artifacts
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
artifacts/windows-build/*.exe
artifacts/linux-appimage/*.AppImage
artifacts/linux-deb/*.deb
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}