Skip to content

Commit

Permalink
Merge pull request #57 from PeculiarVentures:ci-release
Browse files Browse the repository at this point in the history
Update build for ARM64
  • Loading branch information
microshine authored Mar 26, 2024
2 parents d156635 + 35528c3 commit f04d52a
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 21 deletions.
125 changes: 105 additions & 20 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Build library
on: [push]
on:
push:
branches:
- master

jobs:
macos:
Expand All @@ -10,24 +13,30 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Use Node.js v16
uses: actions/setup-node@v3
uses: actions/checkout@v4
- name: Use Node.js v20
uses: actions/setup-node@v4
with:
node-version: '16'
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
# - name: Run tests
# run: npm test
- name: Create artifacts
uses: actions/upload-artifact@v3
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 ${{ matrix.os }}
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:
Expand All @@ -40,11 +49,11 @@ jobs:
name: Windows ${{ matrix.platform }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Use Node.js v16
uses: actions/setup-node@v3
uses: actions/checkout@v4
- name: Use Node.js v20
uses: actions/setup-node@v4
with:
node-version: '16'
node-version: '20.x'
- name: Install dependencies
run: npm install --ignore-scripts
- name: Install ninja
Expand All @@ -62,10 +71,86 @@ jobs:
run: npm run build:config
- name: Build Library
run: npm run build:r${{ matrix.platform }}
# - name: Run tests
# run: npm test
- name: Create artifacts
uses: actions/upload-artifact@v3
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:
name: Package for ${{ matrix.os }} ${{ matrix.platform }}
path: out/Release_${{ matrix.platform }}/pvpkcs11.dll
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
2 changes: 1 addition & 1 deletion config.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
}
},
'Release_MACARM64': {
'inherit_from': ['Release_MACARM64'],
'inherit_from': ['Release_x86'],
'xcode_settings': {
'ARCHS': ['arm64'],
}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"build:config": "gyp config.gyp",
"build:rx86": "ninja -C out/Release_x86",
"build:rx64": "ninja -C out/Release_x64",
"build:rARM64": "ninja -C out/Release_MACARM64",
"prebuild:rx86": "gyp --D \"target_arch=ia32\" config.gyp",
"build:dx86": "ninja -C out/Debug",
"build:dx64": "ninja -C out/Debug_x64"
Expand Down

0 comments on commit f04d52a

Please # to comment.