-
-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (32 loc) · 1.17 KB
/
publish.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: Publish Module
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
steps:
# Get the current version
- uses: actions/checkout@v3
- name: Install and cache PowerShell modules
id: psmodulecache
uses: potatoqualitee/psmodulecache@v4.5
with:
modules-to-cache: BuildHelpers
- shell: pwsh
# Give an id to the step, so we can reference it later
id: check_if_versions_bumped
run: |
[version]$GalleryVersion = Get-NextNugetPackageVersion -Name RPGDice -ErrorAction Stop
[version]$GithubVersion = Get-MetaData -Path ./RPGDice/RPGDice.psd1 -PropertyName ModuleVersion -ErrorAction Stop
$bumped = $GithubVersion -ge $GalleryVersion
# Set the output named "version_bumped"
Write-Host "::set-output name=version_bumped::$bumped"
- name: Publish to PSGallery
shell: pwsh
if: steps.check_if_versions_bumped.outputs.version_bumped == 'True'
env:
PSGALLERY_API_KEY: ${{ secrets.PS_GALLERY_KEY }}
run: ./build.ps1 -Task Publish -Bootstrap