mirror of
https://github.com/GTNewHorizons/GTNH-Actions-Workflows.git
synced 2026-10-16 20:37:28 +02:00
Reduce B&T Artifact Retention Org-Wide (#72)
This commit is contained in:
@@ -52,6 +52,9 @@ on:
|
|||||||
default: false
|
default: false
|
||||||
type: boolean
|
type: boolean
|
||||||
|
|
||||||
|
env:
|
||||||
|
ARTIFACT_RETENTION_DAYS: ${{ github.event.repository.private && 5 || 30 }}
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
@@ -90,7 +93,7 @@ jobs:
|
|||||||
"repos/${{ github.repository }}/actions/artifacts?name=external-deps-${{ github.run_id }}" \
|
"repos/${{ github.repository }}/actions/artifacts?name=external-deps-${{ github.run_id }}" \
|
||||||
--jq ".artifacts[0].workflow_run.id // empty")
|
--jq ".artifacts[0].workflow_run.id // empty")
|
||||||
echo "run_id=$RUN_ID" >> $GITHUB_OUTPUT
|
echo "run_id=$RUN_ID" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Download external deps
|
- name: Download external deps
|
||||||
if: ${{ inputs.external-deps-inclusion && steps.find-artifact.outputs.run_id != '' }}
|
if: ${{ inputs.external-deps-inclusion && steps.find-artifact.outputs.run_id != '' }}
|
||||||
uses: actions/download-artifact@v8
|
uses: actions/download-artifact@v8
|
||||||
@@ -99,10 +102,10 @@ jobs:
|
|||||||
path: ./.packscripts/
|
path: ./.packscripts/
|
||||||
run-id: ${{ steps.find-artifact.outputs.run_id }}
|
run-id: ${{ steps.find-artifact.outputs.run_id }}
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Install external deps to local maven
|
- name: Install external deps to local maven
|
||||||
if: ${{ inputs.external-deps-inclusion && hashFiles('./.packscripts/**') != '' }}
|
if: ${{ inputs.external-deps-inclusion && hashFiles('./.packscripts/**') != '' }}
|
||||||
run: |
|
run: |
|
||||||
echo "Aquired build artifacts from rebuild job: " && ls -lahR ./.packscripts/
|
echo "Aquired build artifacts from rebuild job: " && ls -lahR ./.packscripts/
|
||||||
bash .gtnh-workflows/scripts/upload-deps-to-localmaven.sh ./.packscripts/required_prs.json
|
bash .gtnh-workflows/scripts/upload-deps-to-localmaven.sh ./.packscripts/required_prs.json
|
||||||
echo "Overriding dependencies of project with versions from local maven:" && cat ~/.gradle/init.gradle
|
echo "Overriding dependencies of project with versions from local maven:" && cat ~/.gradle/init.gradle
|
||||||
@@ -157,14 +160,13 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: ${{ github.repository_id }}-reports
|
name: ${{ github.repository_id }}-reports
|
||||||
path: build/reports/
|
path: build/reports/
|
||||||
retention-days: 90
|
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }}
|
||||||
|
|
||||||
- name: Attempt to make a PR fixing spotless errors
|
- name: Attempt to make a PR fixing spotless errors
|
||||||
if: >-
|
if: >-
|
||||||
${{ !inputs.disable-spotless-pr &&
|
${{ !inputs.disable-spotless-pr &&
|
||||||
failure() && steps.build_mod.conclusion == 'failure' &&
|
failure() && steps.build_mod.conclusion == 'failure' &&
|
||||||
github.event_name == 'pull_request' &&
|
github.event_name == 'pull_request' &&
|
||||||
!github.event.pull_request.draft &&
|
|
||||||
github.event.pull_request.head.repo.full_name == github.repository }}
|
github.event.pull_request.head.repo.full_name == github.repository }}
|
||||||
run: |
|
run: |
|
||||||
git reset --hard
|
git reset --hard
|
||||||
@@ -288,11 +290,12 @@ jobs:
|
|||||||
PR_NUMBER: ${{ github.event.number }}
|
PR_NUMBER: ${{ github.event.number }}
|
||||||
|
|
||||||
- name: Attach compilation artifacts as ZIP
|
- name: Attach compilation artifacts as ZIP
|
||||||
|
if: ${{ !github.event.repository.private }}
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: ${{ github.repository_id }}-build-libs
|
name: ${{ github.repository_id }}-build-libs
|
||||||
path: build/libs/
|
path: build/libs/
|
||||||
retention-days: 90
|
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }}
|
||||||
|
|
||||||
- name: Find individual compilation artifacts
|
- name: Find individual compilation artifacts
|
||||||
id: find-artifacts
|
id: find-artifacts
|
||||||
@@ -315,7 +318,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.find-artifacts.outputs.file_0 }}
|
path: ${{ steps.find-artifacts.outputs.file_0 }}
|
||||||
retention-days: 90
|
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }}
|
||||||
archive: false
|
archive: false
|
||||||
|
|
||||||
- name: Upload individual compilation artifact 2
|
- name: Upload individual compilation artifact 2
|
||||||
@@ -323,7 +326,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.find-artifacts.outputs.file_1 }}
|
path: ${{ steps.find-artifacts.outputs.file_1 }}
|
||||||
retention-days: 90
|
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }}
|
||||||
archive: false
|
archive: false
|
||||||
|
|
||||||
- name: Upload individual compilation artifact 3
|
- name: Upload individual compilation artifact 3
|
||||||
@@ -331,7 +334,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.find-artifacts.outputs.file_2 }}
|
path: ${{ steps.find-artifacts.outputs.file_2 }}
|
||||||
retention-days: 90
|
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }}
|
||||||
archive: false
|
archive: false
|
||||||
|
|
||||||
- name: Upload individual compilation artifact 4
|
- name: Upload individual compilation artifact 4
|
||||||
@@ -339,7 +342,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.find-artifacts.outputs.file_3 }}
|
path: ${{ steps.find-artifacts.outputs.file_3 }}
|
||||||
retention-days: 90
|
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }}
|
||||||
archive: false
|
archive: false
|
||||||
|
|
||||||
- name: Upload individual compilation artifact 5
|
- name: Upload individual compilation artifact 5
|
||||||
@@ -347,7 +350,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.find-artifacts.outputs.file_4 }}
|
path: ${{ steps.find-artifacts.outputs.file_4 }}
|
||||||
retention-days: 90
|
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }}
|
||||||
archive: false
|
archive: false
|
||||||
|
|
||||||
- name: Upload individual compilation artifact 6
|
- name: Upload individual compilation artifact 6
|
||||||
@@ -355,7 +358,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.find-artifacts.outputs.file_5 }}
|
path: ${{ steps.find-artifacts.outputs.file_5 }}
|
||||||
retention-days: 90
|
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }}
|
||||||
archive: false
|
archive: false
|
||||||
|
|
||||||
- name: Upload individual compilation artifact 7
|
- name: Upload individual compilation artifact 7
|
||||||
@@ -363,7 +366,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.find-artifacts.outputs.file_6 }}
|
path: ${{ steps.find-artifacts.outputs.file_6 }}
|
||||||
retention-days: 90
|
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }}
|
||||||
archive: false
|
archive: false
|
||||||
|
|
||||||
- name: Upload individual compilation artifact 8
|
- name: Upload individual compilation artifact 8
|
||||||
@@ -371,7 +374,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.find-artifacts.outputs.file_7 }}
|
path: ${{ steps.find-artifacts.outputs.file_7 }}
|
||||||
retention-days: 90
|
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }}
|
||||||
archive: false
|
archive: false
|
||||||
|
|
||||||
- name: Upload individual compilation artifact 9
|
- name: Upload individual compilation artifact 9
|
||||||
@@ -379,7 +382,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.find-artifacts.outputs.file_8 }}
|
path: ${{ steps.find-artifacts.outputs.file_8 }}
|
||||||
retention-days: 90
|
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }}
|
||||||
archive: false
|
archive: false
|
||||||
|
|
||||||
- name: Upload individual compilation artifact 10
|
- name: Upload individual compilation artifact 10
|
||||||
@@ -387,5 +390,5 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.find-artifacts.outputs.file_9 }}
|
path: ${{ steps.find-artifacts.outputs.file_9 }}
|
||||||
retention-days: 90
|
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }}
|
||||||
archive: false
|
archive: false
|
||||||
|
|||||||
Reference in New Issue
Block a user