mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-12 02:56:56 +08:00
add reusable workflow 'ArtifactCleanUp'
This commit is contained in:
34
.github/workflows/ArtifactCleanUp.yml
vendored
Normal file
34
.github/workflows/ArtifactCleanUp.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
name: ArtifactCleanUp
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
package:
|
||||||
|
description: 'Artifacts to be removed on not tagged runs.'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
remaining:
|
||||||
|
description: 'Artifacts to be removed unconditionally.'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
ArtifactCleanUp:
|
||||||
|
name: 🗑️ Artifact Cleanup
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: 🗑️ Delete package Artifacts
|
||||||
|
if: ${{ ! startsWith(github.ref, 'refs/tags') }}
|
||||||
|
uses: geekyeggo/delete-artifact@v1
|
||||||
|
with:
|
||||||
|
name: ${{ inputs.package }}
|
||||||
|
|
||||||
|
- name: 🗑️ Delete remaining Artifacts
|
||||||
|
if: ${{ inputs.remaining != '' }}
|
||||||
|
uses: geekyeggo/delete-artifact@v1
|
||||||
|
with:
|
||||||
|
name: ${{ inputs.remaining }}
|
||||||
@@ -111,31 +111,18 @@ jobs:
|
|||||||
coverage: ${{ fromJson(needs.Params.outputs.params).artifacts.coverage }}
|
coverage: ${{ fromJson(needs.Params.outputs.params).artifacts.coverage }}
|
||||||
typing: ${{ fromJson(needs.Params.outputs.params).artifacts.typing }}
|
typing: ${{ fromJson(needs.Params.outputs.params).artifacts.typing }}
|
||||||
|
|
||||||
|
|
||||||
ArtifactCleanUp:
|
ArtifactCleanUp:
|
||||||
name: 🗑️ Artifact Cleanup
|
uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@main
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs:
|
needs:
|
||||||
- Params
|
- Params
|
||||||
- Coverage
|
- Coverage
|
||||||
- StaticTypeCheck
|
- StaticTypeCheck
|
||||||
- BuildTheDocs
|
- BuildTheDocs
|
||||||
- PublishToGitHubPages
|
- PublishToGitHubPages
|
||||||
|
with:
|
||||||
steps:
|
package: ${{ fromJson(needs.Params.outputs.params).artifacts.package }}
|
||||||
|
remaining: |
|
||||||
- name: 🗑️ Delete package Artifacts
|
${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-*
|
||||||
if: ${{ ! startsWith(github.ref, 'refs/tags') }}
|
${{ fromJson(needs.Params.outputs.params).artifacts.coverage }}
|
||||||
uses: geekyeggo/delete-artifact@v1
|
${{ fromJson(needs.Params.outputs.params).artifacts.typing }}
|
||||||
with:
|
${{ fromJson(needs.Params.outputs.params).artifacts.doc }}
|
||||||
name: |
|
|
||||||
${{ fromJson(needs.Params.outputs.params).artifacts.package }}
|
|
||||||
|
|
||||||
- name: 🗑️ Delete remaining Artifacts
|
|
||||||
uses: geekyeggo/delete-artifact@v1
|
|
||||||
with:
|
|
||||||
name: |
|
|
||||||
${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-*
|
|
||||||
${{ fromJson(needs.Params.outputs.params).artifacts.coverage }}
|
|
||||||
${{ fromJson(needs.Params.outputs.params).artifacts.typing }}
|
|
||||||
${{ fromJson(needs.Params.outputs.params).artifacts.doc }}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user