-
Notifications
You must be signed in to change notification settings - Fork 189
74 lines (69 loc) · 2.12 KB
/
workflow_ci.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# for a list of available software on the different virtual environments, please see:
# https://github.com/actions/virtual-environments/tree/main/images
name: workflow ci
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 0 1 * *'
jobs:
#checks if this file has changed
check_workflow:
name: check workflow_ci
runs-on: ubuntu-latest
outputs:
any_changed: ${{ steps.changed-files.outputs.any_changed }}
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: check changed files
uses: tj-actions/[email protected]
id: changed-files
with:
files: .github/workflows/workflow_ci.yml
#check if src has changed
check_src:
name: check src
runs-on: ubuntu-latest
outputs:
any_changed: ${{ steps.changed-files.outputs.any_changed }}
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: check changed files
uses: tj-actions/[email protected]
id: changed-files
with:
files: src
build_compute:
name: build compute
runs-on: ubuntu-latest
needs: [check_workflow, check_src]
if: ${{ needs.check_src.outputs.any_changed == 'true' || needs.check_workflow.outputs.any_changed == 'true' }}
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: revision
id: revision
run: |
echo "::set-output name=revision::${GITHUB_SHA::8}"
- name: revision number
shell: pwsh
run: |
echo ${{ steps.revision.outputs.revision }}
(get-content .\src\compute.geometry\FixedEndpoints.cs).replace('git_sha = null', 'git_sha = "${{ steps.revision.outputs.revision }}"') | set-content .\src\compute.geometry\FixedEndpoints.cs
- name: build
run: dotnet publish src/compute.sln -c Release
- name: artifacts
if: github.ref == 'refs/heads/8.x'
uses: actions/upload-artifact@v4
with:
path: src/dist
name: rhino.compute