2024-10-02 14:44:51 +08:00
|
|
|
name: Windows CI
|
|
|
|
on: [push]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: [windows11]
|
|
|
|
steps:
|
2024-10-16 00:10:50 +08:00
|
|
|
- name: Set up SSH
|
|
|
|
run: |
|
2024-10-16 00:28:44 +08:00
|
|
|
if (-Not (Test-Path -Path C:\Windows\system32\config\systemprofile\.ssh)) {
|
|
|
|
mkdir C:\Windows\system32\config\systemprofile\.ssh
|
2024-10-16 00:16:50 +08:00
|
|
|
}
|
2024-10-16 00:28:44 +08:00
|
|
|
echo $env:SSH_PRIVATE_KEY | Out-File -FilePath C:\Windows\system32\config\systemprofile\.ssh\id_ed25519 -Encoding ascii
|
2024-10-16 00:46:15 +08:00
|
|
|
icacls C:\Windows\system32\config\systemprofile\.ssh\id_ed25519 /inheritance:r /grant:r "Administrators:F"
|
2024-10-16 00:28:44 +08:00
|
|
|
ssh-keyscan -t ed25519 -p 22022 frp-by1.wwvvww.cn | Out-File -FilePath C:\Windows\system32\config\systemprofile\.ssh\known_hosts -Encoding ascii
|
2024-10-16 00:10:50 +08:00
|
|
|
env:
|
|
|
|
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
|
|
- name: Clone repository
|
|
|
|
run: |
|
|
|
|
$branch = "${{ github.ref }}" -replace '^refs/heads/', ''
|
|
|
|
Write-Host "git clone --depth 1 --branch=$branch ssh://git@frp-by1.wwvvww.cn:22022/${{ env.GITEA_REPOSITORY }}.git"
|
|
|
|
git clone --depth 1 --branch=$branch ssh://git@frp-by1.wwvvww.cn:22022/${{ env.GITEA_REPOSITORY }}.git .
|
|
|
|
git checkout ${{ github.sha }}
|
|
|
|
env:
|
2024-10-16 00:37:45 +08:00
|
|
|
GITEA_REPOSITORY: ${{ gitea.repository }}
|
2024-10-02 14:47:10 +08:00
|
|
|
- name: Build and deploy
|
2024-10-02 14:44:51 +08:00
|
|
|
run: |
|
|
|
|
resources/build.ps1 build
|
|
|
|
resources/build.ps1 deploy
|
2024-10-02 17:01:21 +08:00
|
|
|
resources/build.ps1 changelog
|