Build EnvHelper desktop app
Some checks failed
Build Windows App / build-windows (push) Has been cancelled
Some checks failed
Build Windows App / build-windows (push) Has been cancelled
This commit is contained in:
51
.gitea/workflows/build-windows.yml
Normal file
51
.gitea/workflows/build-windows.yml
Normal file
@@ -0,0 +1,51 @@
|
||||
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"
|
||||
}
|
||||
Reference in New Issue
Block a user