|
1 | | -name: 🛠️ Building AutoCtor |
| 1 | +name: 🛠️ build |
2 | 2 |
|
3 | 3 | on: |
4 | | - workflow_dispatch: |
5 | 4 | push: |
6 | | - branches: |
7 | | - - main |
8 | | - - feature/* |
9 | 5 | tags: |
10 | 6 | - "[0-9]+.[0-9]+.[0-9]+" |
11 | 7 | - "[0-9]+.[0-9]+.[0-9]+-**" |
12 | | - pull_request: |
13 | | - branches: |
14 | | - - main |
15 | 8 |
|
16 | 9 | jobs: |
17 | 10 | test: |
18 | | - name: 🧪 Run tests |
19 | | - runs-on: ubuntu-latest |
20 | | - strategy: |
21 | | - matrix: |
22 | | - roslyn: ["3.11", "4.0", "4.4"] |
23 | | - steps: |
24 | | - - name: 🛒 Check-out code |
25 | | - uses: actions/checkout@v4 |
26 | | - |
27 | | - - name: 📐 Setup .NET Core SDK |
28 | | - uses: actions/setup-dotnet@v4 |
29 | | - with: |
30 | | - global-json-file: src/global.json |
31 | | - |
32 | | - - name: 🔍 Enable problem matchers |
33 | | - run: echo "::add-matcher::.github/matchers/dotnet.json" |
34 | | - |
35 | | - - name: 🛠️ Build code |
36 | | - run: dotnet build --configuration Release |
37 | | - |
38 | | - - name: 🧪 Testing ${{ matrix.roslyn }} code |
39 | | - run: > |
40 | | - dotnet test |
41 | | - --configuration Release |
42 | | - -p:GeneratorVersion=${{ matrix.roslyn }} |
43 | | - --logger GitHubActions |
44 | | - -- |
45 | | - RunConfiguration.CollectSourceInformation=true |
| 11 | + uses: ./.github/workflows/test.yml |
46 | 12 |
|
47 | 13 | build: |
48 | 14 | name: 🛠️ Build |
49 | 15 | runs-on: ubuntu-latest |
50 | | - if: github.ref_type == 'tag' |
| 16 | + needs: test |
51 | 17 | steps: |
52 | 18 | - name: 🛒 Check-out code |
53 | 19 | uses: actions/checkout@v4 |
|
66 | 32 | - name: 🛠️ Build code |
67 | 33 | run: dotnet build --configuration Release -p:Version=${{ github.ref_name }} -p:GitSha=${{ github.sha }} --no-restore |
68 | 34 |
|
69 | | - - name: 📦 Upload Artifact |
70 | | - uses: actions/upload-artifact@v4 |
71 | | - with: |
72 | | - name: nuget |
73 | | - path: nugets/*.nupkg |
74 | | - |
75 | | - publish: |
76 | | - name: 📦 Publish nuget library |
77 | | - runs-on: ubuntu-latest |
78 | | - if: github.ref_type == 'tag' |
79 | | - needs: [test, build] |
80 | | - steps: |
81 | | - - name: 📦 Download Artifact |
82 | | - uses: actions/download-artifact@v4 |
83 | | - with: |
84 | | - name: nuget |
85 | | - |
86 | | - - name: ✈️ Push Nuget |
87 | | - run: dotnet nuget push *.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate |
88 | | - |
89 | | - create-release: |
90 | | - name: 📝 Create GitHub Release |
91 | | - runs-on: ubuntu-latest |
92 | | - if: github.ref_type == 'tag' |
93 | | - needs: [test, build] |
94 | | - permissions: |
95 | | - contents: write |
96 | | - steps: |
97 | | - - name: 🛒 Check-out code |
98 | | - uses: actions/checkout@v4 |
99 | | - |
100 | | - - name: 📦 Download Artifact |
101 | | - uses: actions/download-artifact@v4 |
102 | | - with: |
103 | | - name: nuget |
104 | | - |
105 | 35 | - name: 📝 Generate Release Notes |
106 | | - run: gh release create ${{ github.ref_name }} --draft --generate-notes *.nupkg |
| 36 | + run: gh release create ${{ github.ref_name }} --draft --generate-notes nugets/*.nupkg |
107 | 37 | env: |
108 | 38 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments