Skip to content

2.2.0 final

2.2.0 final #36

Workflow file for this run

name: PublishModule
on:
push:
branches:
- master
paths-ignore:
- '**'
tags:
- 'v*'
workflow_dispatch:
jobs:
# This workflow contains a single job called "publishToGallery"
publishToGallery:
# The type of runner that the job will run on
runs-on: windows-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
uses: actions/checkout@v2
#copy files
- name: Build
shell: pwsh
run: |
"Copying license file"
$moduleName = 'S.DS.P'
Copy-Item -Path "$env:GITHUB_WORKSPACE\LICENSE.TXT" -Destination "$env:GITHUB_WORKSPACE\Module\$moduleName\LICENSE.txt" -Force
"Building module"
&"$env:GITHUB_WORKSPACE\Commands\BuildModule.ps1" -RootPath "$env:GITHUB_WORKSPACE" -ModuleName $moduleName
- name: Publish
#Publish to PS Gallery
shell: pwsh
env:
SECRET: ${{ secrets.PSGallery_APIKey }}
run: |
write-host "Publishing from: $env:GITHUB_WORKSPACE\S.DS.P"
try
{
Publish-Module -Path "$env:GITHUB_WORKSPACE\Module\S.DS.P" -NuGetApiKey "$env:SECRET"
}
catch
{
Write-Host "Error: $($_.Exception)"
throw
}
- name: Create Release
#Create a release
id: create_release
if: ${{ github.event_name != 'workflow_dispatch' }}
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref }}
draft: false
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: false
name: Release ${{ github.ref }}