Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Updated to new Windower API #509

Merged
merged 3 commits into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .github/scripts/deploy.ps1

This file was deleted.

65 changes: 20 additions & 45 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Build
name: Build;

on:
push:
branches: master
branches: ["master"]
pull_request:
branches: master
branches: ["master"]

defaults:
run:
Expand All @@ -13,15 +13,15 @@ defaults:
jobs:
manifest_check:
name: Validate Manifest
runs-on: windows-2019
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Validate package manifests
run: .github/scripts/check-manifests
syntax_check:
name: Validate Syntax
runs-on: windows-2019
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -34,15 +34,15 @@ jobs:
run: .github/scripts/check-syntax
license_check:
name: Validate License Text
runs-on: windows-2019
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Validate license text
run: .github/scripts/check-license
version_check:
name: Check Version
runs-on: windows-2019
runs-on: windows-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout
Expand All @@ -53,54 +53,29 @@ jobs:
run: .github/scripts/check-versions
build:
name: Build
runs-on: windows-2019
runs-on: windows-latest
steps:
- name: Set up environment
uses: microsoft/setup-msbuild@v1.0.2
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Stage files
run: .github/scripts/stage-files
- name: Build native binaries
run: .github/scripts/build-native-binaries
- name: Build package index
run: .github/scripts/build-package-index
- name: Upload build artifacts
- name: Check out API repo
if: github.event_name == 'push'
uses: actions/upload-artifact@v2
uses: actions/checkout@v4
with:
name: packages
path: .staging
deploy:
name: Deploy
needs: build
runs-on: windows-2019
if: github.event_name == 'push'
steps:
- name: Set up environment
run: |
# Set up environment
Write-Output 'Starting ssh-agent service...'
Get-Service -Name 'ssh-agent' | Set-Service -StartupType Manual
Start-Service -Name 'ssh-agent'
New-Item -ItemType Directory -Force -Path '~/.ssh' *>$null
$env:SSH_KEY | &ssh-add -
&ssh-keyscan -H "$(
@($env:SSH_HOST) + (Resolve-DnsName $env:SSH_HOST).IPAddress -Join ','
)" | Add-Content '~/.ssh/known_hosts'
env:
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_KEY: ${{ secrets.SSH_KEY }}
- name: Checkout
uses: actions/checkout@v2
- name: Download build artifacts
uses: actions/download-artifact@v2
repository: Windower/Api
path: .api
- name: Upload artifacts to Windower server
if: github.event_name == 'push'
uses: ./.api/.github/actions/upload
with:
name: packages
path: .staging
- name: Deploy to server
run: .github/scripts/deploy
env:
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_USER: ${{ secrets.SSH_USER }}
FILES_PATH: ${{ secrets.FILES_PATH }}
url: https://api.windower.net/gh
api-key: ${{secrets.WINDOWER_SERVER_API_KEY}}
repository: ${{github.event.repository.name}}
directory: .staging
Loading