|
1 | | -name: Release |
| 1 | +name: 🚀 Release |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
|
7 | 7 |
|
8 | 8 | jobs: |
9 | 9 | release: |
| 10 | + name: 📦 Build & Publish NuGet Packages |
10 | 11 | runs-on: ubuntu-22.04 |
11 | 12 | permissions: |
12 | 13 | contents: write |
13 | 14 | steps: |
14 | | - - name: Checkout |
15 | | - uses: actions/checkout@v4 |
16 | | - with: |
17 | | - show-progress: false |
18 | | - |
19 | | - - name: Install .NET |
20 | | - uses: actions/setup-dotnet@v4 |
21 | | - with: |
22 | | - dotnet-version: | |
23 | | - 8.x |
24 | | - 9.x |
25 | | -
|
26 | | - - name: Get the version |
27 | | - id: get_version |
28 | | - run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV |
29 | | - |
30 | | - - name: Build Packages |
31 | | - run: | |
32 | | - ./build.sh pack --SemVersion ${{ env.GIT_TAG }} --Configuration Release |
33 | | -
|
34 | | - - name: Push Packages |
35 | | - run: | |
36 | | - ./build.cmd publish --skip |
37 | | - env: |
38 | | - NuGetApiKey: ${{ secrets.NUGETAPIKEY }} |
39 | | - |
40 | | - - name: Get release |
41 | | - id: get_release |
42 | | - run: | |
43 | | - RELEASE_ID=$(gh api repos/ChilliCream/graphql-platform/releases/tags/${{ env.GIT_TAG }} --jq '.id') |
44 | | - UPLOAD_URL=$(gh api repos/ChilliCream/graphql-platform/releases/$RELEASE_ID --jq '.upload_url') |
45 | | - echo "RELEASE_ID=$RELEASE_ID" >> $GITHUB_ENV |
46 | | - echo "UPLOAD_URL=${UPLOAD_URL}" >> $GITHUB_ENV |
47 | | - env: |
48 | | - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
49 | | - |
50 | | - - name: Upload Release Assets |
51 | | - run: | |
52 | | - for file in ./output/packages/*.nupkg; do |
53 | | - echo "Uploading $file" |
54 | | - gh release upload ${{ env.GIT_TAG }} "$file" --repo ChilliCream/graphql-platform |
55 | | - done |
56 | | - env: |
57 | | - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 15 | + - name: 📦 Checkout |
| 16 | + uses: actions/checkout@v4 |
| 17 | + with: |
| 18 | + show-progress: false |
| 19 | + |
| 20 | + - name: 🛠 Install .NET |
| 21 | + uses: actions/setup-dotnet@v4 |
| 22 | + with: |
| 23 | + dotnet-version: | |
| 24 | + 8.x |
| 25 | + 9.x |
| 26 | + 10.x |
| 27 | +
|
| 28 | + - name: 🏷 Get the version from tag |
| 29 | + id: get_version |
| 30 | + run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV |
| 31 | + |
| 32 | + - name: 📦 Build NuGet Packages |
| 33 | + run: | |
| 34 | + ./build.sh pack --SemVersion ${{ env.GIT_TAG }} --Configuration Release |
| 35 | +
|
| 36 | + - name: 🚀 Push Packages to NuGet |
| 37 | + run: | |
| 38 | + ./build.cmd publish --skip |
| 39 | + env: |
| 40 | + NuGetApiKey: ${{ secrets.NUGETAPIKEY }} |
| 41 | + |
| 42 | + - name: 🔎 Get GitHub Release Info |
| 43 | + id: get_release |
| 44 | + run: | |
| 45 | + RELEASE_ID=$(gh api repos/ChilliCream/graphql-platform/releases/tags/${{ env.GIT_TAG }} --jq '.id') |
| 46 | + UPLOAD_URL=$(gh api repos/ChilliCream/graphql-platform/releases/$RELEASE_ID --jq '.upload_url') |
| 47 | + echo "RELEASE_ID=$RELEASE_ID" >> $GITHUB_ENV |
| 48 | + echo "UPLOAD_URL=${UPLOAD_URL}" >> $GITHUB_ENV |
| 49 | + env: |
| 50 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 51 | + |
| 52 | + - name: 📤 Upload .nupkg Release Assets |
| 53 | + run: | |
| 54 | + for file in ./output/packages/*.nupkg; do |
| 55 | + echo "📤 Uploading $file" |
| 56 | + gh release upload ${{ env.GIT_TAG }} "$file" --repo ChilliCream/graphql-platform |
| 57 | + done |
| 58 | + env: |
| 59 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments