diff --git a/.github/actions/create-draft-release-with-assets/action.yml b/.github/actions/create-draft-release-with-assets/action.yml new file mode 100644 index 0000000..87a67dc --- /dev/null +++ b/.github/actions/create-draft-release-with-assets/action.yml @@ -0,0 +1,19 @@ +name: Create draft release with assets +description: Creates a draft GitHub release and attaches asset files found under the given paths +inputs: + asset-paths: + required: true + description: Comma-separated paths/globs passed to Get-ChildItem, e.g. "nugets/, powershellModules/, assets/" +runs: + using: composite + steps: + - name: Create draft release and attach assets + shell: pwsh + run: | + $paths = '${{ inputs.asset-paths }}' -split ',' | ForEach-Object { $_.Trim() } + $assets = (Get-ChildItem -Path $paths -File -Recurse).FullName + Write-Output "Assets to attach: $assets" + Write-Output "Creating draft release for ${{ github.event.repository.name }} ${{ github.ref_name }} at commit ${{ github.sha }}" + gh release create ${{ github.ref_name }} $assets -d -n "" -t "${{ github.ref_name }}" + env: + GH_TOKEN: ${{ github.token }}