Skip to content

Commit fb78564

Browse files
committed
Update github workflows
1 parent 8055b7f commit fb78564

File tree

3 files changed

+60
-45
lines changed

3 files changed

+60
-45
lines changed

.github/workflows/main.yml

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,33 @@
11
name: Build and test
22
on:
3-
push:
4-
branches:
5-
- '*'
6-
pull_request:
7-
branches:
8-
- '*'
3+
push:
4+
branches:
5+
- '*'
6+
pull_request:
7+
branches:
8+
- '*'
99
jobs:
10-
build:
11-
runs-on: ubuntu-latest
12-
timeout-minutes: 3
13-
steps:
14-
- name: Checkout
15-
uses: actions/checkout@v4
16-
- name: Build
17-
run: dotnet build --configuration Release
18-
- name: Test
19-
run: dotnet test --configuration Release --no-build
10+
build:
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 3
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
- name: Build
17+
run: dotnet build --configuration Release --output /var/build
18+
- name: Upload build result
19+
uses: actions/upload-artifact@v4
20+
with:
21+
name: build
22+
path: /var/build
23+
test:
24+
runs-on: ubuntu-latest
25+
needs: build
26+
timeout-minutes: 3
27+
steps:
28+
- name: Download build result
29+
uses: actions/download-artifact@v4
30+
with:
31+
name: build
32+
- name: Test
33+
run: dotnet test --configuration Release --no-build /var/build

.github/workflows/publish.yml

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,24 @@
11
name: Publish to nuget.org
22
on:
3-
push:
4-
tags:
5-
- "v[0-9]+.[0-9]+.[0-9]+"
3+
workflow_run:
4+
workflows: ["Check code quality"]
5+
types:
6+
- completed
7+
push:
8+
tags:
9+
- "v[0-9]+.[0-9]+.[0-9]+"
610
jobs:
7-
build:
8-
runs-on: ubuntu-latest
9-
timeout-minutes: 3
10-
steps:
11-
- name: Checkout
12-
uses: actions/checkout@v4
13-
with:
14-
fetch-depth: 0
15-
- name: Verify commit exists in origin/master
16-
run: git branch --remote --contains | grep origin/master
17-
- name: Extract release notes
18-
run: |
19-
git log --pretty=format:'%d %s' ${GITHUB_REF} | perl -pe 's| \(.*tag: v(\d+.\d+.\d+(-preview\d{3})?)(, .*?)*\)|\n## \1\n|g' > RELEASE-NOTES
20-
- name: Set VERSION variable from tag
21-
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
22-
- name: Build
23-
run: dotnet build /warnaserror --configuration Release /p:Version=${VERSION}
24-
- name: Test
25-
run: dotnet test --configuration Release /p:Version=${VERSION} --no-build
26-
- name: Pack
27-
run: dotnet pack --configuration Release /p:Version=${VERSION} --no-build --output .
28-
- name: Push nuget to nuget.org
29-
run: dotnet nuget push RxTelegram.Bot.*.nupkg -k ${{secrets.NUGET_API_KEY}} -s https://api.nuget.org/v3/index.json
11+
publish:
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 3
14+
steps:
15+
- name: Download build result
16+
uses: actions/download-artifact@v4
17+
with:
18+
name: build
19+
- name: Set VERSION variable from tag
20+
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
21+
- name: Pack
22+
run: dotnet pack --configuration Release /p:Version=${VERSION} --no-build --output .
23+
- name: Push nuget to nuget.org
24+
run: dotnet nuget push RxTelegram.Bot.*.nupkg -k ${{secrets.NUGET_API_KEY}} -s https://api.nuget.org/v3/index.json

.github/workflows/sonarqube.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
name: Check code quality
2-
on: [ push, pull_request ]
2+
on:
3+
push:
4+
pull_request:
5+
workflow_run:
6+
workflows: ["Build and test"]
7+
types:
8+
- completed
39
jobs:
4-
build:
5-
name: Build
10+
sonarqube:
11+
name: sonarqube
612
runs-on: windows-latest
713
steps:
814
- name: Set up JDK 17

0 commit comments

Comments
 (0)