-
-
Notifications
You must be signed in to change notification settings - Fork 45
58 lines (49 loc) · 3.18 KB
/
ci.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
name: Build for CI
on:
push:
branches: [ "main" ]
paths-ignore:
- "**.md"
pull_request:
branches: [ "main" ]
jobs:
build-plugin-ci:
runs-on: windows-latest
env:
NuGetVersion: "3.0.0-preview2.${{ github.run_id }}${{ github.run_attempt }}"
steps:
- uses: actions/checkout@v4
- name: Restore dependencies
run: dotnet restore src\Plugin.Maui.Audio\Plugin.Maui.Audio.csproj
- name: Build
run: dotnet build src\Plugin.Maui.Audio\Plugin.Maui.Audio.csproj -c Release
# - name: Pack
# if: github.repository_owner == 'jfversluis' # Only run when on main repo, secrets are not available to forks
# run: dotnet pack src\Plugin.Maui.Audio\Plugin.Maui.Audio.csproj -o output -p:PackageVersion=${{ env.NuGetVersion }}
# - name: Add NuGet Source for Push
# if: github.repository_owner == 'jfversluis' # Only run when on main repo, secrets are not available to forks
# run: dotnet nuget add source https://jfversluis.pkgs.visualstudio.com/Plugin.Maui.Audio/_packaging/Plugin.Maui.Audio/nuget/v3/index.json --name PrivateFeed --username ${{ secrets.PUBLISH_USER }} --password ${{ secrets.PUBLISH_PAT }}
# - name: Push
# if: github.repository_owner == 'jfversluis' # Only run when on main repo, secrets are not available to forks
# run: dotnet nuget push "output\*.nupkg" --source PrivateFeed --api-key AzureArtifacts
# - name: Create status
# if: success() && github.event_name == 'pull_request' && github.repository_owner == 'jfversluis' # Only run when on main repo, secrets are not available to forks
# shell: bash
# run: |
# curl --request POST \
# --url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.event.pull_request.head.sha }} \
# --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
# --header 'content-type: application/json' \
# --fail \
# --data-binary @- << EOF
# {
# "state": "success",
# "context": "NuGet ${{ env.NuGetVersion }}",
# "description": "Feed: https://jfversluis.pkgs.visualstudio.com/Plugin.Maui.Audio/_packaging/Plugin.Maui.Audio/nuget/v3/index.json",
# "target_url": "https://github.com/jfversluis/Plugin.Maui.Audio/wiki/Preview-Packages",
# "output": {
# "title": "Install NuGets Generated by Pull Requests",
# "summary": "A NuGet package has been generated as part of pull request #${{ github.event.number }}. Note that these versions do not necessarily represent (upcoming) releases so while it's great to test things out, make sure you don't use this NuGet in production, things might change later or not be merged at all. Please do let us know the findings from your testing with this! The URL for the NuGet feed is: https://jfversluis.pkgs.visualstudio.com/Plugin.Maui.Audio/_packaging/Plugin.Maui.Audio/nuget/v3/index.json. The version number of this NuGet package is: ${{ env.NuGetVersion }} Detailed instructions on how to add a NuGet feed to your Visual Studio can be found on [Microsoft Learn](https://learn.microsoft.com/azure/devops/artifacts/nuget/consume)."
# }
# }
# EOF