Skip to content

Add workaround for legacy package managers #2731

Add workaround for legacy package managers

Add workaround for legacy package managers #2731

Workflow file for this run

name: CI
on:
push:
branches:
- '*'
tags:
- v*
env:
#OPENTAP_COLOR: auto # github messes with the "auto" detection (i.e. it has no effect), and "always" breaks a lot of things
OPENTAP_ANSI_COLORS: true
OPENTAP_NO_UPDATE_CHECK: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_CONSOLE_ANSI_COLOR: true
jobs:
GetVersion:
runs-on: ubuntu-20.04
outputs:
ShortVersion: ${{ steps.gitversion.outputs.ShortVersion }}
LongVersion: ${{ steps.gitversion.outputs.LongVersion }}
GitVersion: ${{ steps.gitversion.outputs.GitVersion }}
steps:
# The get-gitversion action installs OpenTAP and fetches with fetch-depth: 0
- name: GitVersion
id: gitversion
uses: opentap/get-gitversion@v1.1
CheckSecrets:
runs-on: ubuntu-latest
environment: sign
outputs:
gitlab_registry_token_is_set: ${{ steps.check_GITLAB_REGISTRY_TOKEN.outputs.is_set }}
sign_is_set: ${{ steps.check_sign.outputs.is_set }}
steps:
- id: check_GITLAB_REGISTRY_TOKEN
name: Check whether GITLAB_REGISTRY_TOKEN is set
run: |
if [ -z "${{ secrets.GITLAB_REGISTRY_TOKEN }}" ]; then
echo "Not set"
echo "is_set=false" >> $GITHUB_OUTPUT
else
echo "Set"
echo "is_set=true" >> $GITHUB_OUTPUT
fi
- id: check_sign
name: Check whether sign secrets are set
run: |
if [ -z "${{ secrets.SIGN_SERVER_CERT }}" -o \
-z "${{ secrets.TAP_SIGN_ADDRESS }}" -o \
-z "${{ secrets.TAP_SIGN_AUTH }}" -o \
-z "${{ secrets.S3_KEY_ID }}" -o \
-z "${{ secrets.S3_SECRET }}" ]; then
echo "Not set"
echo "is_set=false" >> $GITHUB_OUTPUT
else
echo "Set"
echo "is_set=true" >> $GITHUB_OUTPUT
fi
##############
### BUILDS ###
##############
Build-DevGuide:
needs: CheckSecrets
if: needs.CheckSecrets.outputs.gitlab_registry_token_is_set == 'true'
runs-on: ubuntu-latest
container:
image: registry.gitlab.com/opentap/buildrunners/documentationgeneration:latest
credentials:
username: github
password: ${{ secrets.GITLAB_REGISTRY_TOKEN}}
steps:
- name: Checkout
uses: actions/checkout@v3
- run: tap generate-pdf "doc/Developer Guide/Readme.md" --toc --skip-first-file --out "sdk/Examples/OpenTAP Developer Guide.pdf" --frontpage "doc/Developer Guide/Frontpage.html" --frontpage-file "doc/Developer Guide/Frontpage.png"
- name: Upload binaries
uses: actions/upload-artifact@v3
with:
name: doc-devguide
retention-days: 5
path: |
sdk/Examples/OpenTAP Developer Guide.pdf
Build-ApiDoc:
needs: CheckSecrets
if: needs.CheckSecrets.outputs.gitlab_registry_token_is_set == 'true'
runs-on: ubuntu-latest
container:
image: registry.gitlab.com/opentap/buildrunners/doxygen:alpine
credentials:
username: github
password: ${{ secrets.GITLAB_REGISTRY_TOKEN}}
steps:
- name: Checkout
uses: actions/checkout@v3
- run: |
mkdir Help API
ver=$(grep ^version .gitversion | sed 's/version[ ]*=[ ]*//' | cut -d. -f 1-2)
sed -i "s/\$(GitVersion)/$ver/" "doc/API Documentation/Doxyfile"
rootdir=`pwd`
cd "doc/API Documentation"
doxygen Doxyfile
cd apiref/html
chmcmd index.hhp
mv OpenTapApiReference.chm $rootdir/Help/
cp -r . $rootdir/API/
- name: Upload binaries (CHM)
uses: actions/upload-artifact@v3
with:
name: doc-api-chm
retention-days: 5
path: Help/OpenTapApiReference.chm
- name: Upload binaries (HTML)
uses: actions/upload-artifact@v3
with:
name: doc-api-html
retention-days: 5
path: API
Build-Pages:
runs-on: ubuntu-latest
needs:
- Build-ApiDoc
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Prepare
run: rm 'doc/User Guide/Readme.md' 'doc/Developer Guide/Readme.md'
- name: Download API Artifacts
uses: actions/download-artifact@v3
with:
name: doc-api-html
path: API
- name: Pages Cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- uses: actions/setup-node@v3
name: Setup NPM
with:
node-version: 14
- name: Install
run: npm install
working-directory: doc
- name: Build
run: npm run build
working-directory: doc
- name: Copy API
run: cp -r API public/api
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: startsWith(github.ref, 'refs/tags/v')
with:
publish_dir: public
deploy_key: ${{ secrets.PAGES_DEPLOY_TOKEN }}
publish_branch: main
external_repository: opentap/opentap.github.io
Build-Linux:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fix tags
if: startsWith(github.ref, 'refs/tags/v')
run: git fetch -f origin ${{ github.ref }}:${{ github.ref }} # Fixes an issue with actions/checkout@v3. See https://github.com/actions/checkout/issues/290
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: Build
run: dotnet publish -c Release OpenTAP.sln
- name: Copy Debug Package
run: cp ./bin/Release/OpenTap.Debug.TapPackage ./bin/Release/publish/dbg.zip
- name: Upload binaries
uses: actions/upload-artifact@v3
with:
name: Linux-bin
retention-days: 5
path: |
bin/Release/publish/*
Build-Win:
runs-on: windows-2022
strategy:
matrix:
Architecture: [x86, x64]
needs: GetVersion
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fix tags
if: startsWith(github.ref, 'refs/tags/v')
run: git fetch -f origin ${{ github.ref }}:${{ github.ref }} # Fixes an issue with actions/checkout@v3. See https://github.com/actions/checkout/issues/290
- name: Nuget Cache
uses: actions/cache@v2
id: cache
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} #hash of project files
restore-keys: ${{ runner.os }}-nuget-
- name: Stamp Version
run: |
$AssemblyVersion = "`"${{needs.GetVersion.outputs.ShortVersion}}.0`""
$AssemblyFileVersion = "`"${{needs.GetVersion.outputs.ShortVersion}}`""
$GitVersion = "`"${{needs.GetVersion.outputs.GitVersion}}`""
Push-Location ./tap/Properties
$AssemblyInfoFile = (Get-Content AssemblyInfo.cs.Template)
$AssemblyInfoFile = ($AssemblyInfoFile) -replace '"AssemblyVersion"', $AssemblyVersion
$AssemblyInfoFile = ($AssemblyInfoFile) -replace '"AssemblyFileVersion"', $AssemblyFileVersion
$AssemblyInfoFile = ($AssemblyInfoFile) -replace '"AssemblyInformationalVersion"', $GitVersion
$AssemblyInfoFile | Set-Content AssemblyInfo.cs
cat AssemblyInfo.cs
Pop-Location
- name: Restore
#if: steps.cache.outputs.cache-hit != 'true'
run: |
dotnet restore /p:Platform=${{ matrix.Architecture }}
- name: Build
run: |
dotnet build --no-restore -c Release /p:Platform=${{ matrix.Architecture }}
dotnet build --no-restore tap/tap.csproj -c Release /p:Platform=${{ matrix.Architecture }}
get-content ./bin/Release/tap.runtimeconfig.json
- name: Upload binaries
uses: actions/upload-artifact@v3
with:
name: win-${{ matrix.Architecture }}-bin
retention-days: 5
path: |
bin/Release/*
Build-MacOS:
runs-on: macos-11
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fix tags
if: startsWith(github.ref, 'refs/tags/v')
run: git fetch -f origin ${{ github.ref }}:${{ github.ref }} # Fixes an issue with actions/checkout@v3. See https://github.com/actions/checkout/issues/290
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: Build
run: dotnet publish -c Release OpenTAP.sln
- name: Copy Debug Package
run: cp ./bin/Release/OpenTap.Debug.TapPackage ./bin/Release/publish/dbg.zip
- name: Upload binaries
uses: actions/upload-artifact@v3
with:
name: MacOS-bin
retention-days: 5
path: |
bin/Release/publish/*
##############
### TESTS ###
##############
TestEngine:
runs-on: windows-2022
needs: Build-Win
strategy:
matrix:
retries: [ 0, 1 ]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fix tags
if: startsWith(github.ref, 'refs/tags/v')
run: git fetch -f origin ${{ github.ref }}:${{ github.ref }} # Fixes an issue with actions/checkout@v3. See https://github.com/actions/checkout/issues/290
- name: Download binaries
uses: actions/download-artifact@v3
with:
name: win-x64-bin
path: bin/
- name: Test
run: |
$ErrorActionPreference = "Stop"
dotnet vstest bin/OpenTap.UnitTests.dll --logger:"console;verbosity=detailed" -- RunConfiguration.TestSessionTimeout=1200000 RunConfiguration.TreatNoTestsAsError=true
TestPackage:
runs-on: windows-2022
needs: Build-Win
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fix tags
if: startsWith(github.ref, 'refs/tags/v')
run: git fetch -f origin ${{ github.ref }}:${{ github.ref }} # Fixes an issue with actions/checkout@v3. See https://github.com/actions/checkout/issues/290
- name: Download binaries
uses: actions/download-artifact@v3
with:
name: win-x64-bin
path: bin/Release
- name: Test
run: |
$ErrorActionPreference = "Stop"
#Copy-Item .\bin\Release\runtimes\win-x64\native\git2-b7bad55.dll .\bin\Release
cd bin/Release
dotnet vstest /framework:.NETFramework,Version=v4.62 /Platform:x64 OpenTap.Package.UnitTests.dll --logger:"console;verbosity=detailed" -- RunConfiguration.TreatNoTestsAsError=true
TestWindowsPlan:
runs-on: windows-2022
needs: Build-Win
strategy:
matrix:
retries: [ 0, 1 ]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fix tags
if: startsWith(github.ref, 'refs/tags/v')
run: git fetch -f origin ${{ github.ref }}:${{ github.ref }} # Fixes an issue with actions/checkout@v3. See https://github.com/actions/checkout/issues/290
- name: Download binaries
uses: actions/download-artifact@v3
with:
name: win-x64-bin
path: bin/Release/
- name: Test
run: |
cd bin/Release
./tap.exe run ../../tests/regression.TapPlan --verbose --color
- uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: regression-files
path: |
NewProj*/**
TestLinuxPlan:
runs-on: ubuntu-20.04
needs: Build-Linux
strategy:
matrix:
retries: [ 0, 1 ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: Download binaries
uses: actions/download-artifact@v3
with:
name: Linux-bin
path: bin/Release/
- name: Test
run: |
chmod +x bin/Release/tap
# The .pdb files are in use for some reason during `tap package install`
rm ./bin/Release/*.pdb
./bin/Release/tap package install ./bin/Release/dbg.zip -f --no-isolation
./bin/Release/tap run tests/regression.TapPlan --verbose --color
TestMacPlan:
runs-on: macos-11
needs: Build-MacOS
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: Download binaries
uses: actions/download-artifact@v3
with:
name: MacOS-bin
path: bin/Release/
- name: Test
run: |
chmod +x bin/Release/tap
./bin/Release/tap package install ./bin/Release/dbg.zip -f
bin/Release/tap run tests/regression.TapPlan --verbose --color
###############
### Package ###
###############
Package-Win:
if: needs.CheckSecrets.outputs.sign_is_set == 'true'
runs-on: windows-2022
environment: sign
strategy:
matrix:
Architecture: [x86, x64]
needs:
- CheckSecrets
- Build-Win
- Build-ApiDoc
- GetVersion
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fix tags
if: startsWith(github.ref, 'refs/tags/v')
run: git fetch -f origin ${{ github.ref }}:${{ github.ref }} # Fixes an issue with actions/checkout@v3. See https://github.com/actions/checkout/issues/290
- name: Download x64 binaries
uses: actions/download-artifact@v3
with:
name: win-x64-bin
path: bin/Release-x64/
- name: Download x86 binaries
uses: actions/download-artifact@v3
with:
name: win-x86-bin
path: bin/Release-x86/
- name: Download API Reference
uses: actions/download-artifact@v3
with:
name: doc-api-chm
path: Help/
- name: Caching Signing tools
uses: actions/cache@v2
id: cache
with:
path: ./sign.TapPackage
key: ${{ runner.os }}-signpackage-1.3.0 }}
- name: Copy Signing tools
if: steps.cache.outputs.cache-hit != 'true'
run: aws s3 cp s3://ks-github-runner-tools/sign.1.3.0.TapPackage ./sign.TapPackage --region eu-central-1
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET }}
- name: Install Sign
working-directory: bin/Release-x64
run: .\tap.exe package install -f -v --no-isolation ../../sign.TapPackage
- name: Write Sign Cert
env:
TAP_SIGN_CERT: ${{ github.workspace }}/sign.cer
run: echo "${{ secrets.SIGN_SERVER_CERT }}" > $env:TAP_SIGN_CERT
- name: Create Package
working-directory: bin/Release-${{ matrix.Architecture }}
env:
TAP_SIGN_ADDRESS: ${{ secrets.TAP_SIGN_ADDRESS }}
TAP_SIGN_AUTH: ${{ secrets.TAP_SIGN_AUTH }}
TAP_SIGN_CERT: ${{ github.workspace }}/sign.cer
Sign: ${{github.ref == 'refs/heads/main' || contains(github.ref, 'refs/heads/release') || contains(github.ref, 'refs/tags/v')}}
Platform: "Windows"
Architecture: "${{ matrix.Architecture }}"
run: ..\Release-x64\tap.exe package create -v -c ../../package.xml -o ../../OpenTAP.${{ needs.GetVersion.outputs.GitVersion }}.${{ matrix.Architecture }}.Windows.TapPackage
- uses: actions/upload-artifact@v3
with:
name: win-${{ matrix.Architecture }}-package
retention-days: 14
path: |
OpenTAP.*.Windows.TapPackage
Package-Cross:
runs-on: ubuntu-latest
needs:
- Build-Linux
- Build-MacOS
- Build-ApiDoc
- GetVersion
strategy:
matrix:
include:
- os: MacOS
arch: arm64
- os: Linux
arch: x64
- os: Linux
arch: arm
- os: Linux
arch: arm64
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fix tags
if: startsWith(github.ref, 'refs/tags/v')
run: git fetch -f origin ${{ github.ref }}:${{ github.ref }} # Fixes an issue with actions/checkout@v3. See https://github.com/actions/checkout/issues/290
- name: Download linux binaries
uses: actions/download-artifact@v3
with:
name: Linux-bin
path: bin/Linux-x64/
- name: Download binaries
uses: actions/download-artifact@v3
with:
name: ${{ matrix.os }}-bin
path: bin/output/
- name: Download API Reference
uses: actions/download-artifact@v3
with:
name: doc-api-chm
path: Help/
- name: Manually copy the correct newtonsoft dll here since it was overwritten by a unittest
run: cp Installer/Assets/Newtonsoft.Json.dll bin/output/
- name: Set execute permissions
run: chmod +x bin/Linux-x64/tap
- name: Package
working-directory: bin/output/
run: ../Linux-x64/tap package create -v -c ../../package.xml -o Packages/OpenTAP.${{ matrix.os }}.${{ matrix.arch }}.TapPackage
env:
Platform: ${{ matrix.os }}
Architecture: ${{ matrix.arch }}
Sign: false
- name: Rename package
run: cp bin/output/Packages/OpenTAP.${{ matrix.os }}.${{ matrix.arch }}.TapPackage OpenTAP.${{ needs.GetVersion.outputs.GitVersion }}.${{ matrix.os }}.${{ matrix.arch }}.TapPackage
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-${{ matrix.arch }}-package
retention-days: 14
path: |
OpenTAP.*.TapPackage
Package-Templates:
runs-on: windows-2022
needs:
- GetVersion
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: Update Version
run: |
Set-Content .\templates\Templates.csproj (Get-Content .\templates\Templates.csproj).Replace("`$(GitVersion)", "${{needs.GetVersion.outputs.LongVersion}}")
Set-Content .\templates\src\project\ProjectName.csproj (Get-Content .\templates\src\project\ProjectName.csproj).Replace("`$(GitVersion)", "${{needs.GetVersion.outputs.LongVersion}}")
- name: Package
run: dotnet pack ./templates/
- uses: actions/upload-artifact@v3
with:
name: package-templates
retention-days: 14
path: ./bin/Release/OpenTAP.Templates.*.nupkg
Package-SDK:
runs-on: windows-2022
needs:
- Build-Win
- Build-DevGuide
- Build-ApiDoc
- GetVersion
- Package-Templates
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fix tags
if: startsWith(github.ref, 'refs/tags/v')
run: git fetch -f origin ${{ github.ref }}:${{ github.ref }} # Fixes an issue with actions/checkout@v3. See https://github.com/actions/checkout/issues/290
- name: Download binaries
uses: actions/download-artifact@v3
with:
name: win-x64-bin
path: bin/Release/
- name: Download Developer Guide
uses: actions/download-artifact@v3
with:
name: doc-devguide
path: sdk/Examples/
- name: Download API Reference
uses: actions/download-artifact@v3
with:
name: doc-api-chm
path: Help/
- name: Download Template package
uses: actions/download-artifact@v3
with:
name: package-templates
path: bin/Release/Packages2/SDK/
- name: Package
run: |
$env:Sign = "false"
$env:Architecture = "x86"
$env:Platform = "Windows"
cd bin/Release
Remove-Item -Recurse -Force ./Packages
#cp .\runtimes\win-x64\native\git2-b7bad55.dll .
.\tap.exe package create ../../package.xml --install -v -c
Copy-Item "../../sdk/Examples" "Packages/SDK/Examples" -Recurse
Copy-Item "../../Package/PackageSchema.xsd" "Packages/SDK/PackageSchema.xsd"
cd Packages/SDK/Examples
$doc = New-Object System.Xml.XmlDataDocument
$doc.PreserveWhitespace=1
$doc.Load("$pwd/Directory.Build.props")
$ele = $doc.GetElementsByTagName("PropertyGroup") | Where-Object { $_.GetElementsByTagName("GitVersion").Count -gt 0 }
$doc.FirstChild.RemoveChild($ele) # First Child is the Project element
$doc.Save("$pwd/Directory.Build.props")
cd ../../..
Move-Item "Packages2/SDK/OpenTap.Templates.*.nupkg" "Packages/SDK/"
$content=(Get-Content Packages/SDK/Examples/Directory.Build.props).Replace("`$(GitVersion)", "${{needs.GetVersion.outputs.LongVersion}}")
Set-Content Packages/SDK/Examples/Directory.Build.props $content
./tap package create -v -c ../../sdk/sdk.package.xml
Move-Item "*.TapPackage" "../.."
- uses: actions/upload-artifact@v3
with:
name: package-sdk
retention-days: 14
path: |
SDK.*.TapPackage
Package-Diff:
runs-on: ubuntu-20.04
needs:
- Package-Cross
steps:
- uses: opentap/setup-opentap@v1.0
with:
version: 9.21.1
packages: 'Package Diff:0.1.0-beta.19+2b1aa952'
- name: Download package
uses: actions/download-artifact@v3
with:
name: Linux-x64-package
path: .
- name: Rename Package
run: mv OpenTAP.*.TapPackage OpenTAP.TapPackage
- name: Diff Package
run: tap package diff OpenTAP.TapPackage -o diff
Package-NuGet:
runs-on: windows-2022
needs:
- Build-Win
- Package-Win
- Package-Cross
- GetVersion
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fix tags
if: startsWith(github.ref, 'refs/tags/v')
run: git fetch -f origin ${{ github.ref }}:${{ github.ref }} # Fixes an issue with actions/checkout@v3. See https://github.com/actions/checkout/issues/290
- name: Download binaries
uses: actions/download-artifact@v3
with:
name: win-x64-bin
path: bin/Release/
- name: Download x86 package
uses: actions/download-artifact@v3
with:
name: win-x86-package
path: .
- name: Download x64 package
uses: actions/download-artifact@v3
with:
name: win-x64-package
path: .
- name: Download Linux package
uses: actions/download-artifact@v3
with:
name: Linux-x64-package
path: .
- name: Download MacOS package
uses: actions/download-artifact@v3
with:
name: MacOS-arm64-package
path: .
- name: Package
run: |
#cp bin\Release\runtimes\win-x64\native\git2-b7bad55.dll bin\Release
$content=(Get-Content ./nuget/OpenTAP.nuspec).Replace("`$(GitVersion)", "${{needs.GetVersion.outputs.LongVersion}}")
Set-Content ./nuget/OpenTAP.nuspec $content
New-Item -Force ./nuget/build/payload -ItemType Directory | Out-Null
# Expand-Archive will only extract .zip extensions
Move-Item OpenTAP.*.x86.Windows.TapPackage OpenTAP.x86.zip
Move-Item OpenTAP.*.x64.Windows.TapPackage OpenTAP.x64.zip
Move-Item OpenTAP.*.Linux.*.TapPackage OpenTAP.Linux.zip
Move-Item OpenTAP.*.MacOS.*.TapPackage OpenTAP.MacOS.zip
Move-Item ./bin/Release/Keysight.OpenTap.Sdk.MSBuild.dll ./nuget/build
Move-Item ./bin/Release/DotNet.Glob.NetStandard1.1.dll ./nuget/build/DotNet.Glob.dll
echo "Install opentap"
./bin/Release/tap package install ./OpenTap.x64.zip -t ./nuget/build/payload -f -v --no-isolation
# package.xml, tap.dll, and tap.runtimeconfig.json of an installation should always come from
# one of the Runtime directories. Delete it from the payload directory.
Remove-Item ./nuget/build/payload/Packages/OpenTAP/package.xml
# these files only exists when building for net6.0.
#Remove-Item ./nuget/build/payload/tap.dll
#Remove-Item ./nuget/build/payload/tap.runtimeconfig.json
Move-Item ./bin/Release/OpenTap.Package.xml ./nuget/build/payload
Move-Item ./bin/Release/OpenTap.xml ./nuget/build/payload
Push-Location ./nuget/build/payload
Remove-Item tap.exe
Remove-Item ./Dependencies/LibGit2Sharp.0.27.0.0/git2*.dll
Pop-Location
echo "Expand archive"
Expand-Archive OpenTAP.x64.zip win-x64 -Verbose
Expand-Archive OpenTAP.x86.zip win-x86 -Verbose
Expand-Archive OpenTAP.Linux.zip linux-x64 -Verbose
Expand-Archive OpenTAP.MacOS.zip macos-arm64 -Verbose
./nuget/NugetPackager.ps1
cd ./nuget
Invoke-WebRequest -Method Get -Uri "https://dist.nuget.org/win-x86-commandline/v5.7.1/nuget.exe" -OutFile nuget.exe
echo "Pack nuget"
.\nuget pack OpenTAP.nuspec -OutputDirectory ../
- uses: actions/upload-artifact@v3
with:
name: nuget-package
retention-days: 14
path: |
*.nupkg
Build-Installer-Windows:
runs-on: ubuntu-latest
environment: sign
needs:
- GetVersion
- Package-Win
container:
#beta.5 was force-overwritten so now we are using a sha256 hash for a docker image.
image: ghcr.io/opentap/smartinstaller@sha256:f9cc89cce025be9b7dad011347a02b8c4304655f343aff1ac9396d22b148ec42
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download Windows package
uses: actions/download-artifact@v3
with:
name: win-x64-package
path: .
- run: mv OpenTAP.*.Windows.TapPackage Installer/Assets/OpenTAP.TapPackage
- run: echo "${{ secrets.SIGN_SERVER_CERT }}" > $GITHUB_WORKSPACE/sign.cer
- run: tap installer create "opentap.installer.xml" -v --target-os win
working-directory: Installer/Assets
env:
TAP_SIGN_ADDRESS: ${{ secrets.TAP_SIGN_ADDRESS }}
TAP_SIGN_AUTH: ${{ secrets.TAP_SIGN_AUTH }}
TAP_SIGN_CERT: ${{ github.workspace }}/sign.cer
- run: mv Installer/Assets/setup.exe OpenTAP.${{needs.GetVersion.outputs.LongVersion}}.exe
- uses: actions/upload-artifact@v3
with:
name: installer-windows
retention-days: 14
path: OpenTAP.*.exe
Publish-Installer-Windows:
if: contains(github.ref, 'refs/heads/release') || contains(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main'
environment: packages.opentap.io
runs-on: ubuntu-latest
needs:
- Build-Installer-Windows
- GetVersion
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: installer-windows
- name: Rename Artifact
run: mv OpenTAP.*.exe OpenTAP.exe
- name: Upload Installer
env:
REPO_WWW_PASS: ${{ secrets.REPO_WWW_PASS }}
run: |
curl -i -X POST 'http://packages.opentap.io/4.0/Objects/www/' \
-H 'Metadata-Version: "${{ needs.GetVersion.outputs.LongVersion }}"' \
-H 'Metadata-OS: "Windows"' \
-H "Auth-Key: $REPO_WWW_PASS" \
--form 'file=@"'$(pwd)'/OpenTAP.exe"'
Build-Installer-Linux:
runs-on: ubuntu-latest
needs:
- GetVersion
- Package-Cross
container:
image: ghcr.io/opentap/smartinstaller:2.1.0-beta.12
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download Linux package
uses: actions/download-artifact@v3
with:
name: Linux-x64-package
path: .
- run: mv OpenTAP.*.Linux.*.TapPackage Installer/Assets/OpenTAP.TapPackage
name: Rename package
- run: tap installer create "opentap.installer.linux.xml" -v --target-os linux
working-directory: Installer/Assets
name: Build installer
- run: mv Installer/Assets/Installer Installer/Assets/OpenTAP
- uses: actions/upload-artifact@v3
with:
name: installer-linux
retention-days: 14
path: Installer/Assets/OpenTAP
Publish-Installer-Linux:
if: contains(github.ref, 'refs/heads/release') || contains(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main'
environment: packages.opentap.io
runs-on: ubuntu-latest
needs:
- Build-Installer-Linux
- GetVersion
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: installer-linux
- name: Upload Installer
env:
REPO_WWW_PASS: ${{ secrets.REPO_WWW_PASS }}
run: |
curl -i -X POST 'http://packages.opentap.io/4.0/Objects/www/' \
-H 'Metadata-Version: "${{ needs.GetVersion.outputs.LongVersion }}"' \
-H 'Metadata-OS: "Linux"' \
-H "Auth-Key: $REPO_WWW_PASS" \
--form 'file=@"'$(pwd)'/OpenTAP"'
Docker-Linux:
runs-on: ubuntu-20.04
environment: sign
strategy:
matrix:
include:
- target: production
tag-suffix: "-slim"
- target: development
tag-suffix: ""
- target: production-hardened
tag-suffix: "-slim-hardened"
needs:
- Package-Cross
- GetVersion
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download Linux package
uses: actions/download-artifact@v3
with:
name: Linux-x64-package
path: .
- name: Prepare
run: |
mv OpenTAP.*.Linux.*.TapPackage docker/Linux/OpenTAP.Linux.TapPackage
echo "TAG_NAME=alpha" >> $GITHUB_ENV
- name: Set tag (beta)
if: github.ref == 'refs/heads/main'
run: echo "TAG_NAME=beta" >> $GITHUB_ENV
- name: Set tag (rc)
if: contains(github.ref, 'refs/heads/release')
run: echo "TAG_NAME=rc" >> $GITHUB_ENV
- name: Set tag (release)
if: contains(github.ref, 'refs/tags/v')
run: echo "TAG_NAME=${{needs.GetVersion.outputs.ShortVersion}}" >> $GITHUB_ENV
- name: Docker Build
uses: aevea/action-kaniko@master
with:
image: opentapio/opentap
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
target: ${{ matrix.target }}
tag: ${{env.TAG_NAME}}${{ matrix.tag-suffix }}
path: docker/Linux
###############
### Publish ###
###############
Publish-NuGet:
if: github.ref == 'refs/heads/main' || contains(github.ref, 'refs/heads/release') || contains(github.ref, 'refs/tags/v')
environment: nuget.org
runs-on: windows-2022
needs:
- Package-NuGet
steps:
- name: Download nuget package
uses: actions/download-artifact@v3
with:
name: nuget-package
path: .
- name: Package
run: nuget push OpenTAP.*.nupkg ${{ secrets.NUGET_KEY }} -NonInteractive -Source https://api.nuget.org/v3/index.json
Publish-TapPackages:
if: github.ref == 'refs/heads/main' || contains(github.ref, 'refs/heads/release') || contains(github.ref, 'refs/tags/v')
environment: packages.opentap.io
runs-on: ubuntu-latest
needs:
- Package-Win
- Package-Cross
- Package-SDK
steps:
- name: Download Windows-x86 package
uses: actions/download-artifact@v3
with:
name: win-x86-package
path: ./publish/
- name: Download Windows-x64 package
uses: actions/download-artifact@v3
with:
name: win-x64-package
path: ./publish/
- name: Download MacOS-arm64 package
uses: actions/download-artifact@v3
with:
name: MacOS-arm64-package
path: ./publish/
- name: Download Linux-x64 package
uses: actions/download-artifact@v3
with:
name: Linux-x64-package
path: ./publish/
- name: Download Linux-arm64 package
uses: actions/download-artifact@v3
with:
name: Linux-arm64-package
path: ./publish/
- name: Download Linux-arm package
uses: actions/download-artifact@v3
with:
name: Linux-arm-package
path: ./publish/
- name: Download SDK package
uses: actions/download-artifact@v3
with:
name: package-sdk
path: ./publish/
- name: Install OpenTAP
run: |
wget -O opentap.tar https://www.opentap.io/docs/OpenTAP.9.16.2+f3c96b9f.tar
tar -xf opentap.tar
chmod u+x INSTALL.sh
echo 'y' | ./INSTALL.sh
ln -s -f "$HOME/.tap/tap" /usr/local/bin/tap
- name: Debug
run: ls -la ./publish
- name: Install PackagePublish
run: tap package install -f PackagePublish --version beta
- name: Publish
run: tap package publish -r http://packages.opentap.io -k ${{ secrets.REPO_PASS }} ./publish/*.TapPackage