|
4 | 4 | push: |
5 | 5 | branches: |
6 | 6 | - main |
7 | | - # Sequence of patterns matched against refs/tags |
8 | 7 | tags: |
9 | 8 | - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 |
10 | 9 | jobs: |
11 | 10 | release: |
12 | 11 | runs-on: ubuntu-latest |
| 12 | + permissions: |
| 13 | + packages: write |
| 14 | + contents: read |
13 | 15 | steps: |
14 | 16 | - name: Checkout repository |
15 | 17 | uses: actions/checkout@v4 |
16 | 18 |
|
17 | | - # - name: Setup .NET |
18 | | - # uses: actions/setup-dotnet@v4 |
19 | | - # with: |
20 | | - # dotnet-version: | |
21 | | - # 8.0.x |
22 | | - # 9.0.x |
23 | | - |
| 19 | + - name: Setup .NET |
| 20 | + uses: actions/setup-dotnet@v4 |
| 21 | + with: |
| 22 | + dotnet-version: | |
| 23 | + 8.0.x |
| 24 | + 9.0.x |
24 | 25 | - name: .NET Info |
25 | 26 | run: dotnet --info |
26 | 27 |
|
27 | 28 | - name: Install XML tools |
28 | 29 | run: | |
29 | 30 | sudo apt update |
30 | | - sudo apt install libxml2-utils |
31 | | - sudo apt install xmlstarlet |
| 31 | + sudo apt install libxml2-utils xmlstarlet |
32 | 32 | - name: Read XML |
33 | 33 | id: xml |
34 | 34 | run: | |
@@ -57,27 +57,38 @@ jobs: |
57 | 57 | xml_value=$(xmllint --xpath "string(//Project/PropertyGroup/Version)" ./src/Ocelot.Testing.csproj) |
58 | 58 | echo "Replaced Version: $xml_value" |
59 | 59 | echo "PkgVersion=$xml_value" >> $GITHUB_OUTPUT |
| 60 | +
|
| 61 | + - name: Restore dependencies |
| 62 | + run: dotnet restore ./Ocelot.Testing.sln |
| 63 | + - name: Build project |
| 64 | + run: dotnet build ./src/Ocelot.Testing.csproj --configuration Release --no-restore |
| 65 | + - name: Pack project |
| 66 | + run: dotnet pack ./src/Ocelot.Testing.csproj --configuration Release --output ./packages |
| 67 | + # - name: Publish to GitHub Packages |
| 68 | + # run: dotnet nuget push ./packages/*.nupkg --source "https://nuget.pkg.github.com/ThreeMammals/index.json" --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate |
| 69 | + # - name: Publish to NuGet |
| 70 | + # run: dotnet nuget push ./packages/*.nupkg --source "https://api.nuget.org/v3/index.json" --api-key ${{ secrets.NUGET_API_KEY_2025 }} --skip-duplicate |
60 | 71 | - name: Find assets |
61 | 72 | id: assets |
62 | 73 | run: | |
63 | | - echo "ASSETS=$(find . -name '*.md' -print | tr '\n' ' ')" >> $GITHUB_OUTPUT |
64 | | - echo "ASSETS=$(find . -name '*.md' -printf '%f\n')" |
| 74 | + echo "ASSETS=$(find packages/*.* -print | tr '\n' ' ')" >> $GITHUB_OUTPUT |
| 75 | + echo "ASSETS=$(find packages/ -name '*.*pkg' -printf '%f\n')" |
65 | 76 | - name: Use files in another step |
66 | 77 | run: | |
67 | 78 | echo "Files found: ${{ steps.assets.outputs.ASSETS }}" |
| 79 | +
|
68 | 80 | - name: GitHub Release |
69 | 81 | uses: softprops/action-gh-release@v2 |
70 | 82 | env: |
71 | 83 | PACKAGE_VERSION: ${{ steps.ver.outputs.PkgVersion }} |
72 | 84 | OCELOT_VERSION: ${{ steps.xml.outputs.OcelotRefVer }} |
73 | 85 | with: |
74 | | - tag_name: 0.0.4 # Name of a tag. defaults to github.ref_name |
| 86 | + tag_name: 0.0.5 # Name of a tag. defaults to github.ref_name |
75 | 87 | body: | |
76 | 88 | ## Version [${{ env.PACKAGE_VERSION }}](https://www.nuget.org/packages/Ocelot.Testing/${{ env.PACKAGE_VERSION }}) |
77 | 89 | - Ocelot dependency package: v[${{ env.OCELOT_VERSION }}](https://www.nuget.org/packages/Ocelot/${{ env.OCELOT_VERSION }}) |
78 | 90 | - For Ocelot release: [${{ env.OCELOT_VERSION }}](https://github.com/ThreeMammals/Ocelot/releases/tag/${{ env.OCELOT_VERSION }}) |
79 | | - #files: ${{ steps.assets.outputs.ASSETS }} |
80 | 91 | files: | |
81 | | - *.md |
| 92 | + packages/*.*pkg |
82 | 93 | draft: false |
83 | 94 | prerelease: false |
0 commit comments