Skip to content

updates

updates #49

Workflow file for this run

name: Release and Publish
on:
pull_request_target:
types:
- closed
branches: [ "master" ]
paths-ignore:
- 'docs/**'
- 'README.md'
workflow_dispatch:
env:
PROJECT: verkadaModule
jobs:
findVersion:
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
outputs:
version: ${{ steps.FindVersion.outputs.v }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Find Module Version
id: FindVersion
shell: pwsh
run: |
[version]$version = (Import-PowerShellDataFile "./$env:PROJECT/$env:PROJECT.psd1").ModuleVersion
echo "v=$version" >> $env:GITHUB_OUTPUT
releaseAndPublish:
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
needs: findVersion
steps:
- name: Push Version Tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{needs.findVersion.outputs.version}}
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
- uses: actions/checkout@v4
- name: Publish to PS Gallery
shell: pwsh
run: |
Publish-Module -Path ./$env:PROJECT -NuGetApiKey ${{ secrets.NUGET_API_KEY }}