mirror of
https://github.com/extism/extism.git
synced 2026-01-14 16:28:04 -05:00
It seems like at some point we changed the `release.yml` workflow to create multiple artifacts instead of one `release-artifacts` tarball. I changed the .NET Nuget workflow to be more like Python
76 lines
2.9 KiB
YAML
76 lines
2.9 KiB
YAML
on:
|
|
release:
|
|
types: [published, edited]
|
|
workflow_dispatch:
|
|
|
|
name: Release .NET Native NuGet Packages
|
|
|
|
jobs:
|
|
release-runtimes:
|
|
name: release-dotnet-native
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
filter: tree:0
|
|
|
|
- name: Setup .NET Core SDK
|
|
uses: actions/setup-dotnet@v3.0.3
|
|
with:
|
|
dotnet-version: 7.x
|
|
- name: download release
|
|
run: |
|
|
tag='${{ github.ref }}'
|
|
tag="${tag/refs\/tags\//}"
|
|
gh release download "$tag" -p 'libextism-*.tar.gz'
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Extract Archive
|
|
run: |
|
|
extract_archive() {
|
|
# Check if both pattern and destination are provided
|
|
if [ -z "$1" ] || [ -z "$2" ]; then
|
|
echo "Usage: $0 <filename_pattern> <destination_directory>"
|
|
return 1
|
|
fi
|
|
|
|
# Set the filename pattern and destination directory
|
|
filename_pattern="$1"
|
|
destination_directory="$2"
|
|
|
|
# Find the archive file with the specified pattern
|
|
archive_file=$(ls $filename_pattern 2>/dev/null)
|
|
|
|
# Check if an archive file is found
|
|
if [ -n "$archive_file" ]; then
|
|
echo "Found archive file: $archive_file"
|
|
|
|
# Create the destination directory if it doesn't exist
|
|
mkdir -p "$destination_directory"
|
|
|
|
# Extract the archive to the specified destination
|
|
tar -xzvf "$archive_file" -C "$destination_directory"
|
|
|
|
echo "Extraction complete. Contents placed in: $destination_directory"
|
|
else
|
|
echo "No matching archive file found with the pattern: $filename_pattern"
|
|
fi
|
|
}
|
|
|
|
extract_archive "libextism-x86_64-pc-windows-msvc-*.tar.gz" "nuget/runtimes/win-x64/native/"
|
|
extract_archive "libextism-aarch64-apple-darwin-*.tar.gz" "nuget/runtimes/osx-arm64/native/"
|
|
extract_archive "libextism-x86_64-apple-darwin-*.tar.gz" "nuget/runtimes/osx-x64/native/"
|
|
extract_archive "libextism-x86_64-unknown-linux-gnu-*.tar.gz" "nuget/runtimes/linux-x64/native/"
|
|
extract_archive "libextism-aarch64-unknown-linux-gnu-*.tar.gz" "nuget/runtimes/linux-arm64/native/"
|
|
extract_archive "libextism-aarch64-unknown-linux-musl-*.tar.gz" "nuget/runtimes/linux-musl-arm64/native/"
|
|
|
|
- name: Pack NuGet packages
|
|
run: |
|
|
find ./nuget -type f -name "*.csproj" -exec dotnet pack {} -o release-artifacts \;
|
|
|
|
- name: Publish NuGet packages
|
|
run: |
|
|
dotnet nuget push --source https://api.nuget.org/v3/index.json ./release-artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }}
|