-
Notifications
You must be signed in to change notification settings - Fork 14
70 lines (60 loc) · 2.43 KB
/
nuget_gsl_arm64_package.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Create GSL ARM64 GitHub Package
on:
workflow_dispatch:
push:
paths:
# Trigger on change to this yml
- '.github/workflows/nuget_gsl_arm64_package.yml'
jobs:
build:
runs-on: windows-2019
steps:
# Step 1: Set up GitHub Packages Authentication
- name: Set up GitHub Packages authentication
run: |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.PACKAGES_TOKEN }}" > ~/.npmrc
shell: bash
# Step 2: Install required tools
- name: Install NuGet
run: |
choco install nuget.commandline
# Step 3: Clone GSL repository
- name: Clone GSL repository
run: |
git clone --branch v2.3.0 https://github.com/ampl/gsl.git
cd gsl
# Step 4: Build the package for ARM64
- name: Build GSL for ARM64
run: |
cd gsl
cmake -B build -G "Visual Studio 16 2019" -A ARM64 -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=build\\install
cmake --build build --target install
# Step 5: Create .nuspec file for GSL (ARM64)
- name: Create .nuspec file for GSL ARM64
shell: bash
run: |
cat <<EOF > gsl/build/install/lib/GSL.nuspec
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>gsl-msvc14-arm64</id>
<version>2.3.0.2779</version>
<authors>PyPop team</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Release GSL for ARM64 as NuGet package.</description>
</metadata>
<files>
<file src="gsl\\build\\install\\**\\*" target="*" />
</files>
</package>
EOF
# Display the contents of the generated .nuspec file
cat gsl/build/install/lib/*.nuspec
# Step 5: Package the build output as a NuGet package
- name: Package the build output
run: |
nuget pack gsl\\build\\install\\lib\\GSL.nuspec -OutputDirectory $(pwd) # Adjust the path to match the actual output location
# Step 7: Publish the NuGet package to GitHub Packages
- name: Publish NuGet package to GitHub Packages
run: |
nuget push *.nupkg -Source https://nuget.pkg.github.com/alexlancaster/index.json -ApiKey ${{ secrets.PACKAGES_TOKEN }}