Skip to content

Commit

Permalink
Move artifact publishing into a composite action
Browse files Browse the repository at this point in the history
  • Loading branch information
AArnott committed Dec 9, 2024
1 parent 130ad67 commit 8a0d319
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 57 deletions.
67 changes: 67 additions & 0 deletions .github/actions/publish-artifacts/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Publish artifacts
description: Publish artifacts

runs:
using: composite
steps:
- name: 📥 Collect artifacts
run: azure-pipelines/artifacts/_stage_all.ps1
shell: pwsh
if: always()

# TODO: replace this hard-coded list with a loop that utilizes the NPM package at
# https://github.com/actions/toolkit/tree/main/packages/artifact (or similar) to push the artifacts.

- name: 📢 Upload project.assets.json files
if: always()
uses: actions/upload-artifact@v4
with:
name: projectAssetsJson-${{ runner.os }}
path: ${{ runner.temp }}/_artifacts/projectAssetsJson
continue-on-error: true
- name: 📢 Upload variables
uses: actions/upload-artifact@v4
with:
name: variables-${{ runner.os }}
path: ${{ runner.temp }}/_artifacts/Variables
continue-on-error: true
- name: 📢 Upload build_logs
if: always()
uses: actions/upload-artifact@v4
with:
name: build_logs-${{ runner.os }}
path: ${{ runner.temp }}/_artifacts/build_logs
continue-on-error: true
- name: 📢 Upload test_logs
if: always()
uses: actions/upload-artifact@v4
with:
name: test_logs-${{ runner.os }}
path: ${{ runner.temp }}/_artifacts/test_logs
continue-on-error: true
- name: 📢 Upload testResults
if: always()
uses: actions/upload-artifact@v4
with:
name: testResults-${{ runner.os }}
path: ${{ runner.temp }}/_artifacts/testResults
continue-on-error: true
- name: 📢 Upload coverageResults
if: always()
uses: actions/upload-artifact@v4
with:
name: coverageResults-${{ runner.os }}
path: ${{ runner.temp }}/_artifacts/coverageResults
continue-on-error: true
- name: 📢 Upload symbols
uses: actions/upload-artifact@v4
with:
name: symbols-${{ runner.os }}
path: ${{ runner.temp }}/_artifacts/symbols
continue-on-error: true
- name: 📢 Upload deployables
uses: actions/upload-artifact@v4
with:
name: deployables-${{ runner.os }}
path: ${{ runner.temp }}/_artifacts/deployables
if: always()
60 changes: 3 additions & 57 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ env:

jobs:
build:
name: 🏭 Build

runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -57,63 +58,8 @@ jobs:
- name: ⚙ Update pipeline variables based on build outputs
run: azure-pipelines/variables/_pipelines.ps1
shell: pwsh
- name: 📥 Collect artifacts
run: azure-pipelines/artifacts/_stage_all.ps1
shell: pwsh
if: always()
- name: 📢 Upload project.assets.json files
if: always()
uses: actions/upload-artifact@v4
with:
name: projectAssetsJson-${{ runner.os }}
path: ${{ runner.temp }}/_artifacts/projectAssetsJson
continue-on-error: true
- name: 📢 Upload variables
uses: actions/upload-artifact@v4
with:
name: variables-${{ runner.os }}
path: ${{ runner.temp }}/_artifacts/Variables
continue-on-error: true
- name: 📢 Upload build_logs
if: always()
uses: actions/upload-artifact@v4
with:
name: build_logs-${{ runner.os }}
path: ${{ runner.temp }}/_artifacts/build_logs
continue-on-error: true
- name: 📢 Upload test_logs
if: always()
uses: actions/upload-artifact@v4
with:
name: test_logs-${{ runner.os }}
path: ${{ runner.temp }}/_artifacts/test_logs
continue-on-error: true
- name: 📢 Upload testResults
if: always()
uses: actions/upload-artifact@v4
with:
name: testResults-${{ runner.os }}
path: ${{ runner.temp }}/_artifacts/testResults
continue-on-error: true
- name: 📢 Upload coverageResults
if: always()
uses: actions/upload-artifact@v4
with:
name: coverageResults-${{ runner.os }}
path: ${{ runner.temp }}/_artifacts/coverageResults
continue-on-error: true
- name: 📢 Upload symbols
uses: actions/upload-artifact@v4
with:
name: symbols-${{ runner.os }}
path: ${{ runner.temp }}/_artifacts/symbols
continue-on-error: true
- name: 📢 Upload deployables
uses: actions/upload-artifact@v4
with:
name: deployables-${{ runner.os }}
path: ${{ runner.temp }}/_artifacts/deployables
if: always()
- name: 📢 Publish artifacts
uses: ./.github/actions/publish-artifacts
- name: 📢 Publish code coverage results to codecov.io
run: ./azure-pipelines/publish-CodeCov.ps1 -CodeCovToken "${{ env.codecov_token }}" -PathToCodeCoverage "${{ runner.temp }}/_artifacts/coverageResults" -Name "${{ runner.os }} Coverage Results" -Flags "${{ runner.os }}"
shell: pwsh
Expand Down

0 comments on commit 8a0d319

Please sign in to comment.