Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Update actions/download-artifact action to v4.1.2 #403

Update actions/download-artifact action to v4.1.2

Update actions/download-artifact action to v4.1.2 #403

Workflow file for this run

name: Madness-publish
on: [push, pull_request]
env:
MADNESS_PRIVATE_SNK: ${{ secrets.MADNESS_PRIVATE_SNK }}
CONFIGURATION: Release
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true
DOTNET_SDK_VERSION: 8.0
permissions: {}
jobs:
publish:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4.1.1
with:
show-progress: false
- name: Setup .NET Core
uses: actions/setup-dotnet@v4.0.0
with:
dotnet-version: ${{ env.DOTNET_SDK_VERSION }}
- name: Verify .NET Core
run: dotnet --info
- name: Prepare private key for signing on Unix
if: startsWith(matrix.os, 'macos-') || startsWith(matrix.os, 'ubuntu-')
shell: sh
run: |
set -eu
if [ -n "${MADNESS_PRIVATE_SNK-}" ]; then
echo "$MADNESS_PRIVATE_SNK" | base64 -d > "resources/Madness.snk"
fi
- name: Prepare private key for signing on Windows
if: startsWith(matrix.os, 'windows-')
shell: pwsh
run: |
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue'
if ((Test-Path env:MADNESS_PRIVATE_SNK) -and ($env:MADNESS_PRIVATE_SNK)) {
echo "$env:MADNESS_PRIVATE_SNK" > "resources\Madness.snk"
certutil -f -decode "resources\Madness.snk" "resources\Madness.snk"
if ($LastExitCode -ne 0) {
throw "Last command failed."
}
}
- name: Publish Madness
run: dotnet pack JustArchiNET.Madness -c "${{ env.CONFIGURATION }}" -o "out" -p:ContinuousIntegrationBuild=true --nologo
- name: Rename Madness on Unix
if: startsWith(matrix.os, 'macos-') || startsWith(matrix.os, 'ubuntu-')
shell: sh
run: |
set -eu
mv out/JustArchiNET.Madness.*.nupkg "out/JustArchiNET.Madness.nupkg"
mv out/JustArchiNET.Madness.*.snupkg "out/JustArchiNET.Madness.snupkg"
- name: Rename Madness on Windows
if: startsWith(matrix.os, 'windows-')
shell: pwsh
run: |
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue'
Move-Item -Path out\JustArchiNET.Madness.*.nupkg "out\JustArchiNET.Madness.nupkg"
Move-Item -Path out\JustArchiNET.Madness.*.snupkg "out\JustArchiNET.Madness.snupkg"
- name: Upload Madness.nupkg
uses: actions/upload-artifact@v4.3.0
with:
name: ${{ matrix.os }}_Madness.nupkg
path: out/JustArchiNET.Madness.nupkg
- name: Upload Madness.snupkg
uses: actions/upload-artifact@v4.3.0
with:
name: ${{ matrix.os }}_Madness.snupkg
path: out/JustArchiNET.Madness.snupkg
release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
needs: publish
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4.1.1
with:
show-progress: false
- name: Setup .NET Core
uses: actions/setup-dotnet@v4.0.0
with:
dotnet-version: ${{ env.DOTNET_SDK_VERSION }}
- name: Verify .NET Core
run: dotnet --info
- name: Download Madness.nupkg artifact from windows-latest
uses: actions/download-artifact@v4.1.2
with:
name: windows-latest_Madness.nupkg
path: out
- name: Download Madness.snupkg artifact from windows-latest
uses: actions/download-artifact@v4.1.2
with:
name: windows-latest_Madness.snupkg
path: out
- name: Import GPG key for signing
uses: crazy-max/ghaction-import-gpg@v6.1.0
with:
gpg_private_key: ${{ secrets.ARCHIBOT_GPG_PRIVATE_KEY }}
- name: Generate SHA-512 checksums and signature
shell: sh
run: |
set -eu
(
cd "out"
sha512sum *nupkg > SHA512SUMS
gpg -a -b -o SHA512SUMS.sign SHA512SUMS
)
- name: Upload SHA512SUMS
uses: actions/upload-artifact@v4.3.0
with:
name: SHA512SUMS
path: out/SHA512SUMS
- name: Upload SHA512SUMS.sign
uses: actions/upload-artifact@v4.3.0
with:
name: SHA512SUMS.sign
path: out/SHA512SUMS.sign
- name: Create Madness GitHub release
uses: ncipollo/release-action@v1.13.0
with:
artifacts: "out/*"
bodyFile: .github/RELEASE_TEMPLATE.md
makeLatest: true
name: Madness V${{ github.ref_name }}
token: ${{ secrets.ARCHIBOT_GITHUB_TOKEN }}
- name: Create Madness NuGet release
run: dotnet nuget push "out/JustArchiNET.Madness.nupkg" -k "${{ secrets.MADNESS_NUGET_API_KEY }}" -s "https://api.nuget.org/v3/index.json"