Merge pull request #684 from mcneel/AndyPayne/Compute-298 #748
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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/changed-files@v13.1 | |
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/changed-files@v13.1 | |
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 |