generate .nuspec properly #5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |