Bump actions/upload-artifact from 4.6.0 to 4.6.1 #284
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: CI | |
on: | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '**.md' | |
workflow_dispatch: | |
jobs: | |
ci: | |
runs-on: ${{ matrix.os }} | |
name: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ windows-2022, ubuntu-22.04 ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.2.2 | |
- name: Create artifacts to test release | |
shell: pwsh | |
run: | | |
# Fake MinVer environment variables | |
$major = Get-Date -Format "yyyy" | |
$minor = Get-Date -Format "Mdd" | |
$patch = Get-Random | |
echo "MinVerVersion=$major.$minor.$patch" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
echo "MinVerMajor=$major" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
echo "MinVerMinor=$minor" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
# Create NuGet packages and assets | |
mkdir nugets | |
mkdir assets | |
echo "This is asset 1" > assets/asset-1.txt | |
echo "This is asset 2" > assets/asset-2.txt | |
echo "This is not really a NuGet package" > nugets/Fake.Package1.nupkg | |
echo "This is not really a NuGet package" > nugets/Fake.Package2.nupkg | |
- name: Run | |
uses: ./ | |
with: | |
octopus-deploy-api-key: ${{ secrets.OCTOPUS_DEPLOY_API_KEY }} | |
- name: Validate | |
shell: pwsh | |
run: | | |
echo "Outputting contents of Metadata.ps1:" | |
cat packaging/Metadata.ps1 | |
echo "" | |
echo "Outputting all files in the packaging directory:" | |
$contents = Get-ChildItem -Recurse -Path packaging | Select-Object -Property FullName | |
echo $contents | Out-String -Width 1000 | |
# Directory entry, Metadata.ps1, Octopus-generated nuspec, + 2 assets & 2 nupkg | |
if (($contents | Measure-Object).Count -ne 7) { | |
throw "Unexpected number of files in packaging directory" | |
} | |
echo "" | |
echo "Validation of constructed Octopus Deploy package must be done by manually inspecting the asset in GitHub Actions." | |
- name: Prepare for second test with metadata | |
shell: pwsh | |
run: | | |
# Remove packaging directory from first Run | |
rm -R packaging | |
# Create extra metadata files for use in 2nd Run | |
mkdir metadata | |
echo "This is metadata" > metadata/CustomMetadata1.json | |
echo "This is metadata" > metadata/CustomMetadata2.json | |
echo "This is metadata" > CustomProperties.txt | |
# New fake MinVer environment variables | |
$major = Get-Date -Format "yyyy" | |
$minor = Get-Date -Format "Mdd" | |
$patch = Get-Random | |
echo "MinVerVersion=$major.$minor.$patch" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
echo "MinVerMajor=$major" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
echo "MinVerMinor=$minor" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
- name: Run with extra metadata files | |
uses: ./ | |
with: | |
octopus-deploy-api-key: ${{ secrets.OCTOPUS_DEPLOY_API_KEY }} | |
additional-metadata-paths: | | |
CustomProperties.txt | |
metadata/*.json | |
- name: Validate second test | |
shell: pwsh | |
run: | | |
echo "Outputting contents of Metadata.ps1:" | |
cat packaging/Metadata.ps1 | |
echo "" | |
echo "Outputting all files in the packaging directory:" | |
$contents = Get-ChildItem -Recurse -Path packaging | Select-Object -Property FullName | |
echo $contents | Out-String -Width 1000 | |
# Same 7 previous entries + 3 new custom metadata files | |
if (($contents | Measure-Object).Count -ne 10) { | |
throw "Unexpected number of files in packaging directory" | |
} | |
echo "" | |
echo "Validation of constructed Octopus Deploy package must be done by manually inspecting the asset in GitHub Actions." |