Skip to content

ci: rename asset for ARM64 #64

ci: rename asset for ARM64

ci: rename asset for ARM64 #64

Workflow file for this run

name: Build library
on:
push:
branches:
- master
jobs:
macos:
name: MacOS
strategy:
matrix:
os: [macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Use Node.js v20
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Install dependencies
run: npm install --ignore-scripts
- name: Install ninja
run: brew install ninja
- name: Build
run: |
npm run build:config
npm run build:rx64
npm run build:rARM64
- name: Create artifacts for X64
uses: actions/upload-artifact@v4
with:
name: Package for MacOS x64
path: out/Release_x64/libpvpkcs11.dylib
- name: Create artifacts for ARM64
uses: actions/upload-artifact@v4
with:
name: Package for MacOS ARM64
path: out/Release_MACARM64/libpvpkcs11.dylib
windows:
strategy:
matrix:
os:
- windows-2019
platform:
- x86
- x64
runs-on: ${{ matrix.os }}
name: Windows ${{ matrix.platform }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Use Node.js v20
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Install dependencies
run: npm install --ignore-scripts
- name: Install ninja
shell: powershell
run: |
Add-Type -AssemblyName System.IO.Compression.FileSystem
$ninjaLink = "https://github.com/ninja-build/ninja/releases/download/v1.11.0/ninja-win.zip"
$ninjaZip = "ninja.zip"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Write-Output "Downloading $ninjaLink file"
Invoke-WebRequest -Uri "$ninjaLink" -OutFile $ninjaZip
Write-Output "Extracting $ninjaZip file"
[System.IO.Compression.ZipFile]::ExtractToDirectory($ninjaZip, ".")
- name: Build Config
run: npm run build:config
- name: Build Library
run: npm run build:r${{ matrix.platform }}
- name: Create artifacts
uses: actions/upload-artifact@v4
with:
name: Package for Win ${{ matrix.platform }}
path: out/Release_${{ matrix.platform }}/pvpkcs11.dll
create-release:
name: Create Release
needs: [macos, windows]
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Download artifacts for MacOS x64
uses: actions/download-artifact@v4
with:
name: Package for MacOS x64
path: out/Release_x64
- name: Download artifacts for MacOS ARM64
uses: actions/download-artifact@v4
with:
name: Package for MacOS ARM64
path: out/Release_MACARM64
- name: Download artifacts for Windows x86
uses: actions/download-artifact@v4
with:
name: Package for Win x86
path: out/Release_x86
- name: Download artifacts for Windows x64
uses: actions/download-artifact@v4
with:
name: Package for Win x64
path: out/Release_x64
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.run_number }}
release_name: Release ${{ github.run_number }}
draft: false
prerelease: false
- name: Upload Release Asset MacOS x64
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: out/Release_x64/libpvpkcs11.dylib
asset_name: libpvpkcs11_x64.dylib
asset_content_type: application/x-sharedlib
- name: Upload Release Asset MacOS ARM64
id: upload-release-asset-arm64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: out/Release_MACARM64/libpvpkcs11.dylib
asset_name: libpvpkcs11_arm64.dylib
asset_content_type: application/x-sharedlib
- name: Upload Release Asset Windows x86
id: upload-release-asset-x86
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: out/Release_x86/pvpkcs11.dll
asset_name: pvpkcs11_x86.dll
asset_content_type: application/x-sharedlib
- name: Upload Release Asset Windows x64
id: upload-release-asset-x64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: out/Release_x64/pvpkcs11.dll
asset_name: pvpkcs11_x64.dll
asset_content_type: application/x-sharedlib