mirror of
https://github.com/3proxy/3proxy.git
synced 2026-10-28 22:05:48 +08:00
Some checks are pending
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Waiting to run
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-latest) (push) Waiting to run
C/C++ CI MacOS / ${{ matrix.target }} (macos-15) (push) Waiting to run
C/C++ CI Windows / ${{ matrix.target }} (windows-2022) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (macos-15) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-latest) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (windows-2022) (push) Waiting to run
C/C++ CI cmake / ubuntu-latest (wolfSSL) (push) Waiting to run
A release whose tree has DEVEL and no RELEASE is one of the development branch (release-kind.yml, called by the workflows below). For it only the Windows x64 zip, the x86_64 and arm64 deb packages and the rpm for EL 9 and 10 (x86_64 and arm64) are built and added to the release: no Docker images, no source tarball, no ipk, armhf, watcom, win32 or Windows arm64 builds. docker.yml makes it a prerelease, not "Latest", which also keeps it out of the package repository 3proxy.github.io builds from releases. The packaging reads the version from RELEASE or DEVEL. rpm names the source archive and its directory after the spec's Version, which for 2.0.0-devel is 2.0.0~devel, so that %setup finds it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
118 lines
4.4 KiB
YAML
118 lines
4.4 KiB
YAML
name: Build Win64 3proxy with MSVC
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
ci:
|
|
permissions:
|
|
contents: write
|
|
id-token: write
|
|
attestations: write
|
|
name: "${{ matrix.target }}"
|
|
strategy:
|
|
matrix:
|
|
target:
|
|
- windows-2022
|
|
runs-on: ${{ matrix.target }}
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
# - name: configure
|
|
# run: ./configure
|
|
- name: set date
|
|
run: |
|
|
$NOW = Get-Date -Format "yyMMddHHmmss"
|
|
# a release branch has RELEASE, the development one DEVEL
|
|
if (Test-Path "RELEASE") { $RELEASE = (Get-Content -Path "RELEASE" -Raw).Trim() }
|
|
else { $RELEASE = (Get-Content -Path "DEVEL" -Raw).Trim() }
|
|
echo "NOW=$NOW" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
echo "RELEASE=$RELEASE" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
echo "VERSION=/D `"VERSION=\`"3proxy-$RELEASE\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
echo "BUILDDATE=/D `"BUILDDATE=\`"$NOW\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
- name: install packages
|
|
run: vcpkg install pcre2:x64-windows-static wolfssl:x64-windows-static
|
|
- name: Add msbuild to PATH
|
|
uses: microsoft/setup-msbuild@v3
|
|
- name: make Windows MSVC
|
|
shell: cmd
|
|
run: |
|
|
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
|
D:
|
|
cd "D:/a/3proxy/3proxy"
|
|
set "LIB=%LIB%;c:/vcpkg/installed/x64-windows-static/lib"
|
|
set "INCLUDE=%INCLUDE%;c:/vcpkg/installed/x64-windows-static/include"
|
|
echo "volatile char VerSion[]=^"3APA3A-3proxy-Internal-Build: 3proxy-%RELEASE%-%NOW%\r\n^";" >>src/3proxy.c
|
|
echo %NOW% / %RELEASE% / %BUILDDATE% / %VERSION%
|
|
nmake /F Makefile.msvc WOLFSSL=1
|
|
- name: make dist dir
|
|
shell: cmd
|
|
run: |
|
|
mkdir dist
|
|
mkdir dist\3proxy
|
|
mkdir dist\3proxy\bin64
|
|
mkdir dist\3proxy\cfg
|
|
mkdir dist\3proxy\cfg\sql
|
|
mkdir dist\3proxy\doc
|
|
mkdir dist\3proxy\doc\ru
|
|
mkdir dist\3proxy\doc\html
|
|
mkdir dist\3proxy\doc\html\plugins
|
|
mkdir dist\3proxy\doc\html\man5
|
|
mkdir dist\3proxy\doc\html\man8
|
|
mkdir dist\3proxy\doc\html\devel
|
|
copy bin\3proxy.exe dist\3proxy\bin64\
|
|
copy bin\*.dll dist\3proxy\bin64\
|
|
copy bin\3proxy_crypt.exe dist\3proxy\bin64\
|
|
copy cfg\*.* dist\3proxy\cfg\
|
|
copy cfg\sql\*.* dist\3proxy\cfg\sql\
|
|
copy doc\ru\*.* dist\3proxy\doc\ru\
|
|
copy doc\html\*.* dist\3proxy\doc\html\
|
|
copy doc\html\plugins\*.* dist\3proxy\doc\html\plugins\
|
|
copy doc\html\man8\*.* dist\3proxy\doc\html\man8\
|
|
copy doc\html\man5\*.* dist\3proxy\doc\html\man5\
|
|
copy doc\html\devel\*.* dist\3proxy\doc\html\devel\
|
|
copy copying dist\3proxy\
|
|
copy authors dist\3proxy\
|
|
copy README.md dist\3proxy\
|
|
copy rus.3ps dist\3proxy\
|
|
- name: Get artifact
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: "3proxy-${{ env.RELEASE }}-x64"
|
|
path: dist/
|
|
- name: Create zip
|
|
if: github.event_name == 'release'
|
|
shell: pwsh
|
|
run: Compress-Archive -Path dist/* -DestinationPath 3proxy-${{ env.RELEASE }}-x64.zip
|
|
- name: Checksums and detached signature
|
|
if: github.event_name == 'release'
|
|
shell: bash
|
|
env:
|
|
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
|
|
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
|
run: |
|
|
if [ -z "$GPG_PRIVATE_KEY" ]; then echo "GPG_PRIVATE_KEY is not set"; exit 1; fi
|
|
printf '%s' "$GPG_PRIVATE_KEY" | gpg --batch --import
|
|
KEYID=$(gpg --list-secret-keys --with-colons | awk -F: '/^sec:/{print $5; exit}')
|
|
sha256sum *.zip > SHA256SUMS-win-x64
|
|
gpg --batch --yes --pinentry-mode loopback --passphrase "$GPG_PASSPHRASE" \
|
|
-u "$KEYID" --armor --detach-sign SHA256SUMS-win-x64
|
|
sha256sum -c SHA256SUMS-win-x64
|
|
- name: Attest build provenance
|
|
if: github.event_name == 'release'
|
|
uses: actions/attest-build-provenance@v4
|
|
with:
|
|
subject-path: |
|
|
*.zip
|
|
- name: Upload to release
|
|
if: github.event_name == 'release'
|
|
shell: bash
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
TAG: ${{ github.event.release.tag_name }}
|
|
run: gh release upload "$TAG" *.zip SHA256SUMS-win-x64 SHA256SUMS-win-x64.asc
|