File: release.yml

package info (click to toggle)
scitokens-cpp 1.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 832 kB
  • sloc: cpp: 7,897; ansic: 596; makefile: 14
file content (44 lines) | stat: -rw-r--r-- 1,492 bytes parent folder | download
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
name: Release CD

on:
  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:
  # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release
  release:
    types: [published]

jobs:
  nuget:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Setup NuGet
        uses: NuGet/setup-nuget@v1
        with:
          nuget-api-key: ${{ secrets.nuget_api_key }}
          
      - name: Create NuGet pkg
        working-directory: ./nuget
        run: nuget pack jwt-cpp.nuspec
        
      - name: Publish NuGet pkg
        working-directory: ./nuget
        run: nuget push *.nupkg -Source 'https://api.nuget.org/v3/index.json'
        
  release-asset:
    if: github.event_name != 'workflow_dispatch'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - run: tar --exclude='./.git' -vczf /tmp/jwt-cpp-${{ github.event.release.tag_name }}.tar.gz .
      - uses: shogo82148/actions-upload-release-asset@v1
        with:
          upload_url: ${{ github.event.release.upload_url }}
          asset_path: /tmp/jwt-cpp-${{ github.event.release.tag_name }}.tar.gz
          
      - run: zip -x './.git/*' -r /tmp/jwt-cpp-${{ github.event.release.tag_name }}.zip .
      - uses: shogo82148/actions-upload-release-asset@v1
        with:
          upload_url: ${{ github.event.release.upload_url }}
          asset_path: /tmp/jwt-cpp-${{ github.event.release.tag_name }}.zip