-
Notifications
You must be signed in to change notification settings - Fork 3
50 lines (49 loc) · 1.27 KB
/
PRCodeArtifact.yml
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
45
46
47
48
49
50
---
name: PRCodeArtifact
on:
pull_request:
branches:
- "main"
jobs:
pr_build_check:
name: PR build checks
runs-on: ubuntu-22.04
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Build
run: |
dotnet build src
pack:
name: Pack source code
needs: pr_build_check
runs-on: ubuntu-22.04
permissions:
pull-requests: read
strategy:
fail-fast: false
steps:
- name: Checkout PR
uses: actions/checkout@v3
with:
path: 'pr'
- name: Replace source code to out
run: |
mkdir out && mv pr/src out/src
- name: Pack PR info
run: |
echo "${{ github.run_number }}" >> out/pr_run_number
echo "${{ github.event.pull_request.number }}" >> out/pr_number
echo -n ${{ github.event.pull_request.head.sha }} > out/pr_sha
- name: Upload Kirel.Repositories PR source code as artifact
uses: actions/upload-artifact@v3
with:
name: Kirel.Repositories-DANGER-pr${{ github.event.pull_request.number }}
path: out/*