Skip to content

card-jpki: Use sc_file_free() to release virtual MF #4

card-jpki: Use sc_file_free() to release virtual MF

card-jpki: Use sc_file_free() to release virtual MF #4

Workflow file for this run

name: Windows
on:
pull_request:
paths:
- '**.c'
- '**.h'
- '**.sh'
- .github/workflows/windows.yml
- '**.am'
- '**.mak'
- configure.ac
push:
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
build:
runs-on: ${{ matrix.image }}
strategy:
matrix:
platform: [x86, x64, arm64]
configuration: [Light, Release]
image: [windows-2025]
include:
- platform: x86
setenv: amd64_x86
- platform: x64
setenv: amd64
- platform: arm64
setenv: amd64_arm64
env:
VCPKG_DEFAULT_TRIPLET: ${{ matrix.platform }}-windows-static
BUILD_NUMBER: ${{ github.run_number }}
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Package suffix
shell: bash
run: |
SUFFIX="-${GITHUB_SHA:0:7}"
if [[ "${{ github.ref_type }}" == "tag" ]]; then
if [[ "${{ github.ref_name }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
SUFFIX="" # regular release tag
elif [[ "${{ github.ref_name }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(.+)$ ]]; then
SUFFIX="${BASH_REMATCH[1]}" # rc release tag
fi
fi
PACKAGE_SUFFIX="${SUFFIX}${{ matrix.configuration == 'Light' && '-Light' || '' }}"
sed -i.bak "s|^PACKAGE_SUFFIX=\([-~]*[0-9a-zA-Z]*\)$|PACKAGE_SUFFIX=$PACKAGE_SUFFIX|g" VERSION.mk
cat VERSION.mk
while IFS='=' read -r key value; do
# Skip empty or comment lines
[[ -z "$key" || "$key" =~ ^# ]] && continue
export "$key=$value"
done < VERSION.mk
echo "ARTIFACT_NAME=${PRODUCT_NAME}-${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_FIX}${PACKAGE_SUFFIX}_${{ matrix.platform }}" >> $GITHUB_ENV
- name: Install CPDK
run: choco install windows-cryptographic-provider-development-kit -y > $null
- name: Cache vcpkg
if: matrix.configuration == 'Release'
uses: actions/cache@v6
with:
path: ${{ github.workspace }}/vcpkg_cache
key: vcpkg-${{ matrix.configuration }}-${{ matrix.platform }}-${{ hashFiles('.github/vcpkg.json', '.github/ports/**') }}
- name: Prepare vcpkg
if: matrix.configuration == 'Release'
env:
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
run: |
$installed = "${{ github.workspace }}\vcpkg_installed"
echo "VCPKG_INSTALLED=$installed" >> $env:GITHUB_ENV
C:\vcpkg\vcpkg install `
--overlay-ports=${{ github.workspace }}/.github/ports `
--x-feature=zlib `
--x-feature=openpace `
--x-manifest-root ${{ github.workspace }}/.github `
--x-install-root $installed
- name: Install WIX
run: powershell -ExecutionPolicy Bypass -File .github/setup-wix.ps1
- name: Build OpenSC
run: |
$vsPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
& "$vsPath\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.setenv }} "&&" nmake /nologo /f Makefile.mak opensc.msi
- name: Archive artifacts
id: upload-unsigned-artifact
uses: actions/upload-artifact@v7
with:
name: ${{ env.ARTIFACT_NAME }}
path: ./win32/*.msi
- name: Push to Signpath.io
if: ${{ startsWith(github.ref, 'refs/tags/') && github.repository == 'OpenSC/OpenSC' }}
uses: signpath/github-action-submit-signing-request@v2
with:
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
organization-id: '8d2463fe-39bd-4a41-bb72-f008b4b1fe17'
project-slug: 'OpenSC'
signing-policy-slug: 'release-signing'
github-artifact-id: '${{ steps.upload-unsigned-artifact.outputs.artifact-id }}'
wait-for-completion: false
- name: Archive debug artifacts
uses: actions/upload-artifact@v7
with:
name: ${{ env.ARTIFACT_NAME }}-dbg
path: |
./src/**/*.pdb
./win32/*.pdb
!./src/**/vc*.pdb
!./win32/vc*.pdb