mirror of
https://github.com/3proxy/3proxy.git
synced 2026-08-26 09:55:48 +08:00
Docker: single workflow, one job per image per platform instead of one workflow per registry. Platforms are built in parallel and pushed by digest, then combined into a manifest list pushed to Docker Hub and GHCR at once, so both registries get identical digests. arm64 and arm/v7 build on native arm runners, ppc64le is dropped. Registry provenance/sbom attestations are disabled (they were shown as unknown/unknown entries in the registries), build provenance is attested with actions/attest-build-provenance instead and is verifiable with 'gh attestation verify oci://...'. Release binaries (rpm, deb, zip) are attested the same way. cosign version is pinned and images are signed by digest.
104 lines
3.9 KiB
YAML
104 lines
3.9 KiB
YAML
name: Build Win32 3proxy-lite with Watcom
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
id-token: write
|
|
attestations: write
|
|
|
|
jobs:
|
|
ci:
|
|
name: "${{ matrix.target }}"
|
|
strategy:
|
|
matrix:
|
|
target:
|
|
- windows-2022
|
|
runs-on: ${{ matrix.target }}
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
# - name: configure
|
|
# run: ./configure
|
|
- name: Setup Open Watcom
|
|
uses: open-watcom/setup-watcom@v1
|
|
- name: set date
|
|
run: |
|
|
$NOW = Get-Date -Format "yyMMddHHmmss"
|
|
echo "now: $NOW"
|
|
$RELEASE = Get-Content -Path "RELEASE" -Raw
|
|
echo "release: $RELEASE"
|
|
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: make Watcom
|
|
shell: cmd
|
|
run: |
|
|
echo "volatile char VerSion[]=^"3APA3A-3proxy-Internal-Build: 3proxy-%RELEASE%-%NOW%\r\nCode certificate: https://3proxy.org/3proxy.cer\r\n^";" >>src/3proxy.c
|
|
nmake /F Makefile.watcom
|
|
- name: Decode Certificate
|
|
shell: pwsh
|
|
run: |
|
|
$pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.WINDOWS_CERTIFICATE }}")
|
|
[System.IO.File]::WriteAllBytes("${{ github.workspace }}\cert.pfx", $pfx_cert_byte)
|
|
- name: Sign
|
|
shell: pwsh
|
|
run: |
|
|
$signtool = (Get-ChildItem "C:\Program Files (x86)\Windows Kits\10\bin\*\x64\signtool.exe" | Sort-Object { [version]$_.Directory.Parent.Name } -Descending | Select-Object -First 1).FullName
|
|
& $signtool sign /f "${{ github.workspace }}\cert.pfx" /p "${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}" /tr http://timestamp.digicert.com /td sha256 /fd sha256 "bin\3proxy.exe"
|
|
& $signtool sign /f "${{ github.workspace }}\cert.pfx" /p "${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}" /tr http://timestamp.digicert.com /td sha256 /fd sha256 "bin\3proxy_crypt.exe"
|
|
- name: make dist dir
|
|
shell: cmd
|
|
run: |
|
|
mkdir dist
|
|
mkdir dist\3proxy
|
|
mkdir dist\3proxy\bin
|
|
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\bin\
|
|
copy bin\*.dll dist\3proxy\bin\
|
|
copy bin\3proxy_crypt.exe dist\3proxy\bin\
|
|
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 }}-lite"
|
|
path: dist/
|
|
- name: Create zip
|
|
if: github.event_name == 'release'
|
|
shell: pwsh
|
|
run: Compress-Archive -Path dist/* -DestinationPath 3proxy-${{ env.RELEASE }}-lite.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" 3proxy-${{ env.RELEASE }}-lite.zip
|
|
- name: Attest build provenance
|
|
if: github.event_name == 'release'
|
|
uses: actions/attest-build-provenance@v2
|
|
with:
|
|
subject-path: |
|
|
*.zip
|