Skip to content

Commit 0492581

Browse files
committed
Redoing workflows
1 parent ea0f23c commit 0492581

File tree

3 files changed

+66
-74
lines changed

3 files changed

+66
-74
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,19 @@
1-
name: 🛠️ Building AutoCtor
1+
name: 🛠️ build
22

33
on:
4-
workflow_dispatch:
54
push:
6-
branches:
7-
- main
8-
- feature/*
95
tags:
106
- "[0-9]+.[0-9]+.[0-9]+"
117
- "[0-9]+.[0-9]+.[0-9]+-**"
12-
pull_request:
13-
branches:
14-
- main
158

169
jobs:
1710
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
4612

4713
build:
4814
name: 🛠️ Build
4915
runs-on: ubuntu-latest
50-
if: github.ref_type == 'tag'
16+
needs: test
5117
steps:
5218
- name: 🛒 Check-out code
5319
uses: actions/checkout@v4
@@ -66,43 +32,7 @@ jobs:
6632
- name: 🛠️ Build code
6733
run: dotnet build --configuration Release -p:Version=${{ github.ref_name }} -p:GitSha=${{ github.sha }} --no-restore
6834

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-
10535
- 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
10737
env:
10838
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/publish.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: ✈️ publish
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
publish:
10+
name: 📦 Publish nuget library
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: 📦 Download Artifact
14+
run: gh release download --repo ${{ github.repository }} --pattern '*.nupkg'
15+
env:
16+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
18+
- name: ✈️ Push Nuget
19+
run: dotnet nuget push *.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate

.github/workflows/test.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: 🧪 test
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_call:
6+
push:
7+
branches:
8+
- main
9+
- feature/*
10+
pull_request:
11+
branches:
12+
- main
13+
14+
jobs:
15+
test:
16+
name: 🧪 Run tests
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
roslyn: ["3.11", "4.0", "4.4"]
21+
steps:
22+
- name: 🛒 Check-out code
23+
uses: actions/checkout@v4
24+
25+
- name: 📐 Setup .NET Core SDK
26+
uses: actions/setup-dotnet@v4
27+
with:
28+
global-json-file: src/global.json
29+
30+
- name: 🔍 Enable problem matchers
31+
run: echo "::add-matcher::.github/matchers/dotnet.json"
32+
33+
- name: 🛠️ Build code
34+
run: dotnet build --configuration Release
35+
36+
- name: 🧪 Testing ${{ matrix.roslyn }} code
37+
run: >
38+
dotnet test
39+
--configuration Release
40+
-p:GeneratorVersion=${{ matrix.roslyn }}
41+
--logger GitHubActions
42+
--
43+
RunConfiguration.CollectSourceInformation=true

0 commit comments

Comments
 (0)