Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test nuget pacakge #3

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 46 additions & 5 deletions .github/workflows/sentry-native-windows.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
name: Windows Build (sentry-native)

on:
pull_request:
workflow_dispatch:
inputs:
sentry-native-tag:
type: string
description: The tag of sentry-native to build
required: true

permissions:
contents: write
# required to make OIDC work
id-token: write
packages: write

jobs:
windows:
runs-on: windows-latest
Expand All @@ -17,12 +24,18 @@ jobs:
architecture: ["x64"]

steps:
- name: Checkout swift-sentry sources
uses: actions/checkout@v4
with:
path: "swift-sentry"

- name: Checkout sentry-native sources
uses: actions/checkout@v4
with:
repository: getsentry/sentry-native
path: "sentry-native"
ref: ${{ github.event.inputs.sentry-native-tag }}
# ref: ${{ github.event.inputs.sentry-native-tag }}
ref: "0.6.6"
submodules: 'recursive'

- name: Setup Visual Studio
Expand All @@ -34,19 +47,47 @@ jobs:

- name: Configure sentry-native
run: |
cmake -B build\${{ matrix.architecture }} `
cmake -B ${{ github.workspace }}\build\${{ matrix.architecture }} `
-D CMAKE_BUILD_TYPE=RelWithDebInfo `
-S ${{ github.workspace }}\sentry-native `
-D CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION="10.0.19041.0" `
-G "Visual Studio 17 2022" `
-A ${{ matrix.architecture }}
- name: Build sentry-native
run: cmake --build build\${{ matrix.architecture }} --parallel --config RelWithDebInfo
run: cmake --build ${{ github.workspace }}\build\${{ matrix.architecture }} --parallel --config RelWithDebInfo
- name: Install sentry-native
run: cmake --install build\${{ matrix.architecture }} --prefix install\${{ matrix.architecture }} --config RelWithDebInfo
run: cmake --install ${{ github.workspace }}\build\${{ matrix.architecture }} --prefix ${{ github.workspace }}\install\${{ matrix.architecture }} --config RelWithDebInfo

- name: Package NuGet Package
run: |
$treeish = git -C ${{ github.workspace }}\swift-sentry log -1 --format=%h
nuget pack `
-Properties DESTDIR=${{ github.workspace }}\install\${{ matrix.architecture }} `
-Version 0.6.6-${treeish} `
${{ github.workspace }}\swift-sentry\sentry-native.nuspec

- name: Upload Artifacts
- name: Publish NuGet Package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_USERNAME: thebrowsercompany-bot2
NUGET_PUBLISH_URL: https://nuget.pkg.github.com/thebrowsercompany/index.json
NUGET_SOURCE_NAME: TheBrowserCompany
run: |
nuget sources list | find "%NUGET_SOURCE_NAME%"
if ($errorlevel -eq 0) {
nuget sources remove -name %NUGET_SOURCE_NAME%
}
nuget sources Add -Name %NUGET_SOURCE_NAME% -Source %NUGET_PUBLISH_URL% -username %GITHUB_USERNAME% -password %GITHUB_TOKEN% -StorePasswordInClearText
nuget setApiKey %GITHUB_TOKEN% -Source %NUGET_PUBLISH_URL%
nuget push ${{ github.workspace }}\*.nupkg -Source %NUGET_SOURCE_NAME% -SkipDuplicate

- name: Upload Install Artifacts
uses: actions/upload-artifact@v3
with:
name: sentry-native-windows-${{ github.event.inputs.sentry-native-tag }}-${{ matrix.architecture }}
path: install\${{ matrix.architecture }}

- name: Upload NuGet Package
uses: actions/upload-artifact@v3
with:
path: "*.nupkg"
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ DerivedData/
.netrc
/.sentry-native
Package.resolved
/vendor/**/*.cmake
/vendor/**/*.cmake
*.nupkg
22 changes: 22 additions & 0 deletions sentry-native.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>company.thebrowser.sentry-native.crashpad</id>
<version>0.0.0.0</version>
<title>Sentry Native SDK (Crashpad)</title>
<description>A NuGet package for the Crashpad version of sentry-native</description>
<authors>The Browser Company</authors>
<projectUrl>https://github.com/thebrowsercompany/swift-sentry</projectUrl>
<repository type="git" url="https://github.com/thebrowsercompany/swift-sentry" branch="main"/>
</metadata>
<files>
<file src="$DESTDIR$\bin\crashpad_handler.exe" target="bin"/>
<file src="$DESTDIR$\bin\crashpad_handler.pdb" target="bin"/>
<file src="$DESTDIR$\bin\crashpad_wer.dll" target="bin"/>
<file src="$DESTDIR$\bin\crashpad_wer.pdb" target="bin"/>
<file src="$DESTDIR$\bin\sentry.dll" target="bin"/>
<file src="$DESTDIR$\bin\sentry.pdb" target="bin"/>
<file src="$DESTDIR$\include\sentry.h" target="include"/>
<file src="$DESTDIR$\lib\sentry.lib" target="lib"/>
</files>
</package>