-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
75 lines (70 loc) · 2.66 KB
/
action.yml
File metadata and controls
75 lines (70 loc) · 2.66 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Resolve-PSModuleVersion
description: Resolves the next module version from settings, PR labels, GitHub releases, and the PowerShell Gallery.
author: PSModule
branding:
icon: tag
color: white
inputs:
Settings:
description: The complete settings object as a JSON string (output of Get-PSModuleSettings).
required: true
Name:
description: Name of the module. When empty, the repository name is used.
required: false
WorkingDirectory:
description: The working directory where the script will run from.
required: false
default: '.'
Debug:
description: Enable debug output.
required: false
default: 'false'
Verbose:
description: Enable verbose output.
required: false
default: 'false'
EventPath:
description: Path to the GitHub event JSON file. Defaults to the standard GitHub event path. Override for testing.
required: false
default: ''
EventJson:
description: GitHub event payload as a JSON string. When set, overrides reading from the event file. Use for testing.
required: false
default: ''
outputs:
Version:
description: The Major.Minor.Patch portion of the resolved version.
value: ${{ steps.resolve.outputs.Version }}
Prerelease:
description: The prerelease tag, empty when not a prerelease.
value: ${{ steps.resolve.outputs.Prerelease }}
FullVersion:
description: The full version string including version prefix and prerelease tag (for example v1.4.0-alpha001).
value: ${{ steps.resolve.outputs.FullVersion }}
ReleaseType:
description: The resolved release type - Release, Prerelease, or None.
value: ${{ steps.resolve.outputs.ReleaseType }}
CreateRelease:
description: 'true when a release or prerelease should be created from this run.'
value: ${{ steps.resolve.outputs.CreateRelease }}
runs:
using: composite
steps:
- name: Install-PSModuleHelpers
uses: PSModule/Install-PSModuleHelpers@ed79b6e3aa8c9cd3d30ab2bf02ea6bd4687b9c74 # v1.0.7
- name: Install PSSemVer
shell: pwsh
run: |
Install-PSResource -Name PSSemVer -Repository PSGallery -TrustRepository
- name: Resolve module version
id: resolve
shell: pwsh
working-directory: ${{ inputs.WorkingDirectory }}
env:
PSMODULE_RESOLVE_PSMODULEVERSION_INPUT_Settings: ${{ inputs.Settings }}
PSMODULE_RESOLVE_PSMODULEVERSION_INPUT_Name: ${{ inputs.Name }}
PSMODULE_RESOLVE_PSMODULEVERSION_INPUT_EventJson: ${{ inputs.EventJson }}
PSMODULE_ACTION_PATH: ${{ github.action_path }}
GITHUB_EVENT_PATH: ${{ inputs.EventPath || github.event_path }}
run: |
& "$env:PSMODULE_ACTION_PATH/scripts/main.ps1"