Prepare QCW WinSocat (from revision) #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |