52 lines
1.5 KiB
YAML
52 lines
1.5 KiB
YAML
name: Build Windows App
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- master
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-windows:
|
|
runs-on: windows-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 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: pwsh
|
|
run: |
|
|
$package = Get-Content package.json | ConvertFrom-Json
|
|
$shortSha = $env:GITHUB_SHA.Substring(0, 7)
|
|
$packageVersion = "$($package.version)-$shortSha"
|
|
$headers = @{ Authorization = "token $env:REGISTRY_TOKEN" }
|
|
|
|
Get-ChildItem release -File | ForEach-Object {
|
|
$fileName = [System.Uri]::EscapeDataString($_.Name)
|
|
$uri = "https://git.wilkensxl.de/api/packages/MrSphay/generic/envhelper/$packageVersion/$fileName"
|
|
Invoke-RestMethod -Method Put -Uri $uri -Headers $headers -InFile $_.FullName -ContentType "application/octet-stream"
|
|
}
|