65 lines
1.7 KiB
YAML
65 lines
1.7 KiB
YAML
name: Build Windows App
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- master
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-windows:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
GH_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
|
GITHUB_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
|
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
registry-url: https://registry.npmjs.org
|
|
|
|
- name: Install Windows build dependencies
|
|
run: |
|
|
if command -v sudo >/dev/null 2>&1; then
|
|
SUDO=sudo
|
|
else
|
|
SUDO=
|
|
fi
|
|
|
|
$SUDO dpkg --add-architecture i386
|
|
$SUDO apt-get update
|
|
$SUDO apt-get install -y --no-install-recommends wine wine64 wine32
|
|
wine --version
|
|
|
|
- name: Install dependencies
|
|
run: npm install
|
|
|
|
- name: Build Windows installer
|
|
run: npm run dist:win
|
|
|
|
- name: Upload Windows artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: envhelper-windows
|
|
path: release/*
|
|
|
|
- name: Publish to Gitea package registry
|
|
shell: bash
|
|
run: |
|
|
package_version="$(node -p "require('./package.json').version")-${GITHUB_SHA::7}"
|
|
|
|
for artifact in release/*; do
|
|
[ -f "$artifact" ] || continue
|
|
file_name="$(basename "$artifact")"
|
|
curl --fail-with-body \
|
|
--user "MrSphay:${REGISTRY_TOKEN}" \
|
|
--upload-file "$artifact" \
|
|
"https://git.wilkensxl.de/api/packages/MrSphay/generic/envhelper/${package_version}/${file_name}"
|
|
done
|