Skip to content

Prepare QCW WinSocat (from revision) #1

Prepare QCW WinSocat (from revision)

Prepare QCW WinSocat (from revision) #1

name: Prepare QCW WinSocat (from revision)
on:
workflow_dispatch:
workflow_call:
outputs:
winsocat_version:
description: WinSocat version"
value: ${{ jobs.build.outputs.winsocat_version }}
env:
WINSOCAT_GITURL: https://github.com/firejox/WinSocat.git
WINSOCAT_SHA: ad84bd28b6721c6415b73a37bb4a23aa53936062 # v0.1.3
WINSOCAT_VERSION: 0.1.3
jobs:
build:
runs-on: windows-latest
outputs:
winsocat_version: ${{ steps.make_versions.outputs.winsocat }}
steps:
- name: "πŸ—οΈ Install msys2"
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: >-
git
dos2unix
- name: "πŸ—οΈ Install dotnet"
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
dotnet-quality: 'ga'
- name: "πŸ“ Configure checkout"
run: git config --global core.autocrlf input
- name: "πŸ“ Checkout"
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: "πŸ“ Fetch sources"
shell: msys2 {0}
run: |
mkdir winsocat-release
cd winsocat-release
git init
git remote add origin $WINSOCAT_GITURL
git fetch --depth 1 origin $WINSOCAT_SHA
git checkout FETCH_HEAD
find . -type f -print0 | xargs -0 dos2unix
patch --binary -l -p 1 < ../patches/WinSocat/0001-Pending-0.1.3.patch
patch --binary -l -p 1 < ../patches/WinSocat/0002-Upgrade-to-dontent8.patch
patch --binary -l -p 1 < ../patches/WinSocat/0003-Improve-solution-setup.patch
- name: "πŸ§ͺ Test WinSocat"
working-directory: winsocat-release
shell: pwsh
run: |
dotnet restore
dotnet build --no-restore
dotnet test --no-build
- name: "πŸ› οΈ Build WinSocat"
working-directory: winsocat-release
shell: pwsh
run: |
dotnet restore
dotnet build -c Release --no-restore
dotnet publish winsocat -c Release -r win-x64 -p:PublishDir=../build/x64 -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:EnableCompressionInSingleFile=true -p:PublishReadyToRun=true -p:PublishTrimmed=true --self-contained true
- name: "πŸ“¦ Pack WinSocat"
shell: msys2 {0}
run: |
mkdir -p qcw
cp "winsocat-release/build/x64/"*".exe" qcw/
cd qcw
find . -type f \( ! -iname "*.checksums" \) -exec sha256sum -b {} \; > sha.checksums
find . -type f \( ! -iname "*.checksums" \) -exec sha512sum -b {} \; >> sha.checksums
cat sha.checksums
- id: make_versions
name: "πŸ“Œ Export versions"
shell: msys2 {0}
run: |
echo "winsocat=$WINSOCAT_VERSION" >> "$GITHUB_OUTPUT"
- name: "πŸš€ Upload artifact"
uses: actions/upload-artifact@v4
with:
name: qcw-winsocat
path: qcw