Skip to content

Workflow file for this run

name: Build Windows
on:
push:
# branches: [ "master" ]
pull_request:
branches: ["master"]
env:
VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,readwrite"
jobs:
build:
runs-on: windows-2019
timeout-minutes: 90
permissions:
packages: write
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Bootstrap vcpkg
run: |
./vcpkg/bootstrap-vcpkg.bat
env:
CI: 1
- name: Setup NuGet Credentials
shell: bash
if: ${{ env.has_token == 'true' }}
run: |
`./vcpkg/vcpkg.exe fetch nuget | tail -n 1` \
sources add \
-source "https://nuget.pkg.github.com/Julusian/index.json" \
-storepasswordincleartext \
-name "GitHub" \
-username "Julusian" \
-password "${{ secrets.GITHUB_TOKEN }}"
`./vcpkg/vcpkg.exe fetch nuget | tail -n 1` \
setapikey "${{ secrets.GITHUB_TOKEN }}" \
-source "https://nuget.pkg.github.com/Julusian/index.json"
env:
has_token: ${{ !!secrets.GITHUB_TOKEN && github.repository_owner == 'Julusian' && github.event_name == 'push' }}
- name: Cache nuget
uses: actions/cache@v3
with:
path: dist/packages
key: ${{ runner.os }}-nuget
- name: Run build
shell: bash
run: |
./tools/windows/build.bat
env:
CI: 1
- name: Rename build
id: "rename-build"
shell: bash
run: |
TARGET=casparcg-server-${{ github.sha }}-windows.zip
mv dist/casparcg_server.zip "$TARGET"
echo "artifactname=$TARGET" >> $GITHUB_OUTPUT
# check if a release branch, or master, or a tag
if [[ "${{ github.ref_name }}" == "master" || "${{ github.ref_name }}" == "2.3.x-lts" ]]
then
# Only report if we have an sftp password
if [ -n "${{ secrets.SFTP_PASSWORD }}" ]
then
echo "uploadname=$TARGET" >> $GITHUB_OUTPUT
fi
fi
- uses: actions/upload-artifact@v3
with:
name: upload-artifact
path: ${{ steps.rename-build.outputs.artifactname }}
- name: Copy single file to remote
uses: garygrossgarten/github-action-scp@v0.8.0
if: ${{ steps.rename-build.outputs.uploadname }}
with:
local: "${{ steps.rename-build.outputs.uploadname }}"
remote: "${{ secrets.SFTP_ROOT }}/${{ github.ref_name }}/${{ steps.rename-build.outputs.uploadname }}"
host: ${{ secrets.SFTP_HOST }}
username: ${{ secrets.SFTP_USERNAME }}
password: ${{ secrets.SFTP_PASSWORD }}