Updated workflow #50
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
name: Nuke CICD Pipeline | |
on: | |
push: | |
branches: | |
- prerelease | |
- master | |
tags: | |
- bump-* | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
pre_setup: | |
name: Pre Setup | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Run Nuke PipelinePreSetup | |
run: chmod +x ./build.sh && ./build.sh PipelinePreSetup --args "github" | |
- id: NUKE_PRE_SETUP_HAS_RELEASE | |
name: Output NUKE_PRE_SETUP_HAS_RELEASE | |
run: echo "NUKE_PRE_SETUP_HAS_RELEASE=$(cat ./.nuke/temp/pre_setup_has_release.txt)" >> $GITHUB_OUTPUT | |
- id: NUKE_PRE_SETUP_HAS_ENTRIES | |
name: Output NUKE_PRE_SETUP_HAS_ENTRIES | |
run: echo "NUKE_PRE_SETUP_HAS_ENTRIES=$(cat ./.nuke/temp/pre_setup_has_entries.txt)" >> $GITHUB_OUTPUT | |
- id: NUKE_PRE_SETUP_HAS_TEST | |
name: Output NUKE_PRE_SETUP_HAS_TEST | |
run: echo "NUKE_PRE_SETUP_HAS_TEST=$(cat ./.nuke/temp/pre_setup_has_test.txt)" >> $GITHUB_OUTPUT | |
- id: NUKE_PRE_SETUP_HAS_BUILD | |
name: Output NUKE_PRE_SETUP_HAS_BUILD | |
run: echo "NUKE_PRE_SETUP_HAS_BUILD=$(cat ./.nuke/temp/pre_setup_has_build.txt)" >> $GITHUB_OUTPUT | |
- id: NUKE_PRE_SETUP_HAS_PUBLISH | |
name: Output NUKE_PRE_SETUP_HAS_PUBLISH | |
run: echo "NUKE_PRE_SETUP_HAS_PUBLISH=$(cat ./.nuke/temp/pre_setup_has_publish.txt)" >> $GITHUB_OUTPUT | |
- id: NUKE_PRE_SETUP_OUTPUT | |
name: Output NUKE_PRE_SETUP_OUTPUT | |
run: echo "NUKE_PRE_SETUP_OUTPUT=$(cat ./.nuke/temp/pre_setup_output.json)" >> $GITHUB_OUTPUT | |
- id: NUKE_PRE_SETUP_OUTPUT_TEST_MATRIX | |
name: Output NUKE_PRE_SETUP_OUTPUT_TEST_MATRIX | |
run: echo "NUKE_PRE_SETUP_OUTPUT_TEST_MATRIX=$(cat ./.nuke/temp/pre_setup_output_test_matrix.json)" >> $GITHUB_OUTPUT | |
- id: NUKE_PRE_SETUP_OUTPUT_BUILD_MATRIX | |
name: Output NUKE_PRE_SETUP_OUTPUT_BUILD_MATRIX | |
run: echo "NUKE_PRE_SETUP_OUTPUT_BUILD_MATRIX=$(cat ./.nuke/temp/pre_setup_output_build_matrix.json)" >> $GITHUB_OUTPUT | |
- id: NUKE_PRE_SETUP_OUTPUT_PUBLISH_MATRIX | |
name: Output NUKE_PRE_SETUP_OUTPUT_PUBLISH_MATRIX | |
run: echo "NUKE_PRE_SETUP_OUTPUT_PUBLISH_MATRIX=$(cat ./.nuke/temp/pre_setup_output_publish_matrix.json)" >> $GITHUB_OUTPUT | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
outputs: | |
NUKE_PRE_SETUP_HAS_RELEASE: ${{ steps.NUKE_PRE_SETUP_HAS_RELEASE.outputs.NUKE_PRE_SETUP_HAS_RELEASE }} | |
NUKE_PRE_SETUP_HAS_ENTRIES: ${{ steps.NUKE_PRE_SETUP_HAS_ENTRIES.outputs.NUKE_PRE_SETUP_HAS_ENTRIES }} | |
NUKE_PRE_SETUP_HAS_TEST: ${{ steps.NUKE_PRE_SETUP_HAS_TEST.outputs.NUKE_PRE_SETUP_HAS_TEST }} | |
NUKE_PRE_SETUP_HAS_BUILD: ${{ steps.NUKE_PRE_SETUP_HAS_BUILD.outputs.NUKE_PRE_SETUP_HAS_BUILD }} | |
NUKE_PRE_SETUP_HAS_PUBLISH: ${{ steps.NUKE_PRE_SETUP_HAS_PUBLISH.outputs.NUKE_PRE_SETUP_HAS_PUBLISH }} | |
NUKE_PRE_SETUP_OUTPUT: ${{ steps.NUKE_PRE_SETUP_OUTPUT.outputs.NUKE_PRE_SETUP_OUTPUT }} | |
NUKE_PRE_SETUP_OUTPUT_TEST_MATRIX: ${{ steps.NUKE_PRE_SETUP_OUTPUT_TEST_MATRIX.outputs.NUKE_PRE_SETUP_OUTPUT_TEST_MATRIX }} | |
NUKE_PRE_SETUP_OUTPUT_BUILD_MATRIX: ${{ steps.NUKE_PRE_SETUP_OUTPUT_BUILD_MATRIX.outputs.NUKE_PRE_SETUP_OUTPUT_BUILD_MATRIX }} | |
NUKE_PRE_SETUP_OUTPUT_PUBLISH_MATRIX: ${{ steps.NUKE_PRE_SETUP_OUTPUT_PUBLISH_MATRIX.outputs.NUKE_PRE_SETUP_OUTPUT_PUBLISH_MATRIX }} | |
test: | |
name: Test - ${{ matrix.name }} | |
runs-on: ${{ matrix.runs_on }} | |
steps: | |
- uses: actions/checkout@v4 | |
if: ${{ matrix.id != 'skip' }} | |
- name: Run Nuke PipelineTest | |
run: ${{ matrix.build_script }} PipelineTest --args "${{ matrix.ids_to_run }}" | |
if: ${{ matrix.id != 'skip' }} | |
needs: | |
- pre_setup | |
if: success() | |
env: | |
NUKE_PRE_SETUP_OUTPUT: ${{ needs.pre_setup.outputs.NUKE_PRE_SETUP_OUTPUT }} | |
strategy: | |
matrix: | |
include: ${{ fromJson(needs.pre_setup.outputs.NUKE_PRE_SETUP_OUTPUT_TEST_MATRIX) }} | |
build: | |
name: Build - ${{ matrix.name }} | |
runs-on: ${{ matrix.runs_on }} | |
steps: | |
- uses: actions/checkout@v4 | |
if: ${{ matrix.id != 'skip' }} | |
- name: Run Nuke PipelineBuild | |
run: ${{ matrix.build_script }} PipelineBuild --args "${{ matrix.ids_to_run }}" | |
if: ${{ matrix.id != 'skip' }} | |
env: | |
NUKE_NUGET_AUTH_TOKEN: ${{ secrets.NUGET_AUTH_TOKEN }} | |
NUKE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
if: ${{ matrix.id != 'skip' }} | |
with: | |
name: ${{ matrix.id }} | |
path: ./.nuke/output/* | |
if-no-files-found: error | |
retention-days: 1 | |
needs: | |
- pre_setup | |
- test | |
if: success() | |
env: | |
NUKE_PRE_SETUP_OUTPUT: ${{ needs.pre_setup.outputs.NUKE_PRE_SETUP_OUTPUT }} | |
strategy: | |
matrix: | |
include: ${{ fromJson(needs.pre_setup.outputs.NUKE_PRE_SETUP_OUTPUT_BUILD_MATRIX) }} | |
publish: | |
name: Publish - ${{ matrix.name }} | |
runs-on: ${{ matrix.runs_on }} | |
steps: | |
- uses: actions/checkout@v4 | |
if: ${{ matrix.id != 'skip' }} | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
if: ${{ matrix.id != 'skip' }} | |
with: | |
path: ./.nuke/output | |
pattern: ${{ matrix.id }} | |
merge-multiple: true | |
- name: Run Nuke PipelinePublish | |
run: ${{ matrix.build_script }} PipelinePublish --args "${{ matrix.ids_to_run }}" | |
if: ${{ matrix.id != 'skip' }} | |
env: | |
NUKE_NUGET_AUTH_TOKEN: ${{ secrets.NUGET_AUTH_TOKEN }} | |
NUKE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
needs: | |
- pre_setup | |
- test | |
- build | |
if: success() | |
env: | |
NUKE_PRE_SETUP_OUTPUT: ${{ needs.pre_setup.outputs.NUKE_PRE_SETUP_OUTPUT }} | |
strategy: | |
matrix: | |
include: ${{ fromJson(needs.pre_setup.outputs.NUKE_PRE_SETUP_OUTPUT_PUBLISH_MATRIX) }} | |
post_setup: | |
name: Post Setup | |
runs-on: ubuntu-22.04 | |
steps: | |
- id: NUKE_PUBLISH_SUCCESS | |
name: Resolve NUKE_PUBLISH_SUCCESS | |
run: echo "NUKE_PUBLISH_SUCCESS=${NUKE_PUBLISH_SUCCESS_GITHUB/success/ok}" >> $GITHUB_OUTPUT | |
- uses: actions/checkout@v4 | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: ./.nuke/output | |
- name: Run Nuke PipelinePostSetup | |
run: chmod +x ./build.sh && ./build.sh PipelinePostSetup | |
env: | |
NUKE_PUBLISH_SUCCESS: ${{ steps.NUKE_PUBLISH_SUCCESS.outputs.NUKE_PUBLISH_SUCCESS }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
needs: | |
- pre_setup | |
- test | |
- build | |
- publish | |
if: success() || failure() || always() | |
env: | |
NUKE_PRE_SETUP_OUTPUT: ${{ needs.pre_setup.outputs.NUKE_PRE_SETUP_OUTPUT }} | |
NUKE_PUBLISH_SUCCESS_GITHUB: ${{ needs.publish.result }} |