V2.7.8: maintenance release #77
Workflow file for this run
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
# This is a basic workflow to help you get started with Actions | |
name: CI_RELEASE | |
# Controls when the action will run. Triggers the workflow on release published or release edited request | |
# events but only for the master branch | |
on: | |
release: | |
types: | |
- published | |
# - edited | |
jobs: | |
# This workflow contains a single job called "build_release" | |
build_release: | |
if: ${{ github.repository_owner == 'masesgroup'}} #do not execute outside main repo toavoid push of packages in testing mode | |
# The type of runner that the job will run on | |
runs-on: windows-2022 | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Runs a set of commands using the runners shell | |
# Support longpaths | |
- name: Support long paths | |
run: git config --system core.longpaths true | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: '1' | |
submodules: 'true' | |
- name: Pre compile | |
run: dotnet build --no-incremental --configuration Release /p:Platform="Any CPU" /p:NoWarn="0108%3B1030%3B0618" src\net\KNet\KNet.csproj | |
env: | |
GITHUB_SIMPLIFIED_GENERATION: true | |
- name: Set up Apache Maven Central | |
uses: actions/setup-java@v4 | |
with: # running setup-java again overwrites the settings.xml | |
distribution: temurin | |
java-version: 11 | |
cache: 'maven' | |
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml | |
server-username: MAVEN_USERNAME # env variable for username in deploy | |
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy | |
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase | |
- name: Create Jars | |
run: mvn --file ./src/jvm/knet/pom.xml --no-transfer-progress package | |
env: | |
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} | |
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | |
- name: Compile KNet CLI | |
run: dotnet build --no-incremental --configuration Release /p:Platform="Any CPU" /p:NoWarn="0108%3B1030%3B0618" src\net\KNetCLI\KNetCLI.csproj | |
- name: Compile KNet Connect | |
run: dotnet build --no-incremental --configuration Release /p:Platform="Any CPU" /p:NoWarn="0108%3B1030%3B0618" src\net\KNetConnect\KNetConnect.csproj | |
- name: Compile KNetPS | |
run: dotnet build --no-incremental --configuration Release /p:Platform="Any CPU" /p:NoWarn="0108%3B1030%3B0618" src\net\KNetPS\KNetPS.csproj | |
- uses: nuget/setup-nuget@v2.0.0 | |
with: | |
nuget-version: '5.x' | |
- run: nuget pack src\net\KNetCLI\KNetCLI.nuspec -OutputDirectory .\bin | |
- run: nuget pack src\net\KNetConnect\KNetConnect.nuspec -OutputDirectory .\bin | |
- name: Prepare PowerShell package | |
run: | | |
Copy-Item .\src\net\KNetPS\MASES.KNetPS.psd1 -Destination .\MASES.KNetPS\MASES.KNetPS.psd1 -Force | |
Copy-Item .\src\net\KNetPS\MASES.KNetPS.psm1 -Destination .\MASES.KNetPS\MASES.KNetPS.psm1 -Force | |
shell: pwsh | |
- name: Recompile to create nuget packages | |
run: dotnet build --no-incremental --configuration Release /p:Platform="Any CPU" /p:NoWarn="0108%3B1030%3B0618" src\net\KNet.sln | |
- name: Authenticate to GitHub | |
run: dotnet nuget add source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" | |
- name: Publish to PowerShell Gallery | |
run: | | |
$env:DOTNET_CLI_UI_LANGUAGE="en_US" | |
Publish-Module -Name .\MASES.KNetPS -NuGetApiKey ${{ secrets.MASES_POWERSHELLGALLERY_API_KEY }} | |
shell: pwsh | |
- name: Publish to GitHub | |
run: | | |
nuget push .\bin\*.nupkg -ApiKey ${{ secrets.GITHUB_TOKEN }} -Source "github" -SkipDuplicate | |
nuget push .\bin\*.snupkg -ApiKey ${{ secrets.GITHUB_TOKEN }} -Source "github" -SkipDuplicate | |
- name: Publish to NuGet | |
run: | | |
nuget push .\bin\*.nupkg -ApiKey ${{ secrets.MASES_NUGET_API_KEY }} -Source https://api.nuget.org/v3/index.json -SkipDuplicate | |
nuget push .\bin\*.snupkg -ApiKey ${{ secrets.MASES_NUGET_API_KEY }} -Source https://api.nuget.org/v3/index.json -SkipDuplicate | |