Skip to content

Commit 151cf81

Browse files
feat: Implement automated release process with GitHub Actions
- Remove old publish script and replace it with a new structured approach using init.ps1, publish.ps1, and cleanup.ps1. - Add GitHub Actions workflow for automated releases triggered by pull request events. - Introduce new parameters for managing versioning and release types, including support for prereleases and cleanup of old prereleases. - Enhance logging and error handling throughout the scripts for better traceability.
1 parent f5a4cd4 commit 151cf81

5 files changed

Lines changed: 10 additions & 7 deletions

File tree

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
name: Auto-Release
1+
name: Release
22

3-
run-name: "Auto-Release - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
3+
run-name: "Release - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
44

55
on:
66
pull_request:
@@ -12,6 +12,9 @@ on:
1212
- reopened
1313
- synchronize
1414
- labeled
15+
paths:
16+
- 'action.yml'
17+
- 'src/**'
1518

1619
concurrency:
1720
group: ${{ github.workflow }}-${{ github.ref }}
@@ -22,15 +25,15 @@ permissions:
2225
pull-requests: write
2326

2427
jobs:
25-
Auto-Release:
28+
Release:
2629
runs-on: ubuntu-latest
2730
steps:
2831
- name: Checkout Code
2932
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3033
with:
3134
persist-credentials: false
3235

33-
- name: Auto-Release
36+
- name: Release
3437
uses: PSModule/Auto-Release@eabd533035e2cb9822160f26f2eda584bd012356 # v1.9.5
3538
with:
3639
IncrementalPrerelease: false

action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ runs:
102102
PSMODULE_PUBLISH_PSMODULE_INPUT_PatchLabels: ${{ inputs.PatchLabels }}
103103
PSMODULE_PUBLISH_PSMODULE_INPUT_VersionPrefix: ${{ inputs.VersionPrefix }}
104104
PSMODULE_PUBLISH_PSMODULE_INPUT_WhatIf: ${{ inputs.WhatIf }}
105-
run: ${{ github.action_path }}/scripts/init.ps1
105+
run: ${{ github.action_path }}/src/init.ps1
106106

107107
- name: Download module artifact
108108
if: env.PUBLISH_CONTEXT_ShouldPublish == 'true' || inputs.WhatIf == 'true'
@@ -123,12 +123,12 @@ runs:
123123
PSMODULE_PUBLISH_PSMODULE_INPUT_UsePRBodyAsReleaseNotes: ${{ inputs.UsePRBodyAsReleaseNotes }}
124124
PSMODULE_PUBLISH_PSMODULE_INPUT_UsePRTitleAsReleaseName: ${{ inputs.UsePRTitleAsReleaseName }}
125125
PSMODULE_PUBLISH_PSMODULE_INPUT_UsePRTitleAsNotesHeading: ${{ inputs.UsePRTitleAsNotesHeading }}
126-
run: ${{ github.action_path }}/scripts/publish.ps1
126+
run: ${{ github.action_path }}/src/publish.ps1
127127

128128
- name: Cleanup Prereleases
129129
if: env.PUBLISH_CONTEXT_ShouldCleanup == 'true' || inputs.WhatIf == 'true'
130130
shell: pwsh
131131
working-directory: ${{ inputs.WorkingDirectory }}
132132
env:
133133
PSMODULE_PUBLISH_PSMODULE_INPUT_WhatIf: ${{ inputs.WhatIf }}
134-
run: ${{ github.action_path }}/scripts/cleanup.ps1
134+
run: ${{ github.action_path }}/src/cleanup.ps1
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)