Skip to content

Commit

Permalink
More updates to fix upload/download artifact step
Browse files Browse the repository at this point in the history
  • Loading branch information
AshleighAdams committed Oct 26, 2024
1 parent eabf263 commit a61f020
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/continuous-delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- *setup-dotnet
- *mutation-test
- *mutation-test-archive
- *upload-artifacts
- *mutation-test-upload-artifacts
integration-tests:
name: 'Integration Tests'
needs: build
Expand Down
2 changes: 1 addition & 1 deletion .github/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- *setup-dotnet
- *mutation-test
- *mutation-test-archive
- *upload-artifacts
- *mutation-test-upload-artifacts
integration-tests:
name: 'Integration Tests'
needs: build
Expand Down
11 changes: 5 additions & 6 deletions .github/deploy-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,19 @@ jobs:
run: |
set -x
tag="${GITHUB_REF#refs/*/}"
options=()
options+=("-m" "") # leave the title and body unchanged
files=()
IFS=$'\n';
for asset in $(find ./artifacts -name "verlite-*.tar.gz"); do
options+=("-a" "$asset")
files+=("$asset")
done
IFS=$'\n';
for asset in $(find ./artifacts -name "*.nupkg"); do
options+=("-a" "$asset")
files+=("$asset")
done
hub release edit "${options[@]}" "$tag"
gh release upload "$tag" "${files[@]}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
24 changes: 23 additions & 1 deletion .github/shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ definitions:
mv StrykerOutput ../../artifacts/StrykerOutput
fi
mutation-test-upload-artifacts: &mutation-test-upload-artifacts
name: Upload Artifacts
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: artifacts-mutation-test
if-no-files-found: error
path: |
artifacts/*
publish-codecov: &publish-codecov
name: Publish Codecov
uses: codecov/codecov-action@v2
Expand All @@ -87,12 +97,17 @@ definitions:
if: success() || failure()
with:
name: artifacts
if-no-files-found: error
path: |
artifacts/*
download-artifacts: &download-artifacts
name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: '*'
merge-multiple: true

publish-github: &publish-github
name: Publish Nuget GitHub
Expand Down Expand Up @@ -138,7 +153,14 @@ definitions:
env:
rid: ${{ matrix.rid }}
exe: ${{ matrix.exe }}
- *upload-artifacts
- name: Upload Artifacts
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: artifacts-${{ matrix.rid }}
if-no-files-found: error
path: |
artifacts/*
empty: "hi" # fixes the yml parser from messing the last value up

Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/continuous-delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
if: success() || failure()
with:
name: artifacts
if-no-files-found: error
path: |
artifacts/*
Expand Down Expand Up @@ -116,11 +117,11 @@ jobs:
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: artifacts
name: artifacts-${{ matrix.rid }}
if-no-files-found: error
path: |
artifacts/*
mutation-tests:
name: Mutation Test
needs: build
Expand Down Expand Up @@ -166,7 +167,8 @@ jobs:
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: artifacts
name: artifacts-mutation-test
if-no-files-found: error
path: |
artifacts/*
Expand Down Expand Up @@ -227,6 +229,10 @@ jobs:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: '*'
merge-multiple: true

- name: Publish Nuget GitHub
run: dotnet nuget push 'artifacts/*.nupkg' -k ${GITHUB_TOKEN} -s github --skip-duplicate
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
if: success() || failure()
with:
name: artifacts
if-no-files-found: error
path: |
artifacts/*
Expand Down Expand Up @@ -116,11 +117,11 @@ jobs:
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: artifacts
name: artifacts-${{ matrix.rid }}
if-no-files-found: error
path: |
artifacts/*
mutation-tests:
name: Mutation Test
needs: build
Expand Down Expand Up @@ -166,7 +167,8 @@ jobs:
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: artifacts
name: artifacts-mutation-test
if-no-files-found: error
path: |
artifacts/*
Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/deploy-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
if: success() || failure()
with:
name: artifacts
if-no-files-found: error
path: |
artifacts/*
Expand Down Expand Up @@ -117,11 +118,11 @@ jobs:
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: artifacts
name: artifacts-${{ matrix.rid }}
if-no-files-found: error
path: |
artifacts/*
release:
name: Release
runs-on: ubuntu-latest
Expand Down Expand Up @@ -150,25 +151,28 @@ jobs:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: '*'
merge-multiple: true

- name: Create Release
run: |
set -x
tag="${GITHUB_REF#refs/*/}"
options=()
options+=("-m" "") # leave the title and body unchanged
files=()
IFS=$'\n';
for asset in $(find ./artifacts -name "verlite-*.tar.gz"); do
options+=("-a" "$asset")
files+=("$asset")
done
IFS=$'\n';
for asset in $(find ./artifacts -name "*.nupkg"); do
options+=("-a" "$asset")
files+=("$asset")
done
hub release edit "${options[@]}" "$tag"
gh release upload "$tag" "${files[@]}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down

0 comments on commit a61f020

Please sign in to comment.