Skip to content

Commit

Permalink
fixing the release name issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Mxrcon authored Jul 13, 2022
1 parent 9484b31 commit b093352
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,19 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
output_level: diagnostic
tests_fail_step: true

- name: Release on Powershell Gallery
shell: pwsh
run: |
$ModuleVersion = "${{github.ref_name}}" -replace ('[a-zA-Z\-]', '')
Update-ModuleManifest -Path ./BioNameGenerator/BioNameGenerator.psd1 -ModuleVersion $ModuleVersion
Publish-Module -Path ./BioNameGenerator -NuGetApiKey ${{ secrets.PSGALLERY_KEY }}
- name: Generate a release name
shell: pwsh
id: gen_release
run: |
Install-Module BioNameGenerator
$VersionName = $(Get-RandomPhrase -Start Aminoacids -Middle Brazilian -End Species -Delimiter " ").ToLower()
echo "::set-output name=random_name::$VersionName"
- name: Build Changelog
id: build_changelog
uses: Bullrich/generate-release-changelog@master
Expand All @@ -45,7 +57,10 @@ jobs:
echo "::set-output name=modified::$log"
- name: Write Changelog
run: |
echo "## ${{github.ref_name}}" >> CHANGELOG.md
echo "## ${{github.ref_name}} - ${{ steps.gen_release.outputs.random_name}}" >> release_body.md
echo "${{ steps.modified.outputs.modified }}" >> release_body.md
echo "## ${{github.ref_name}} - ${{ steps.gen_release.outputs.random_name}}" >> CHANGELOG.md
echo "${{ steps.modified.outputs.modified }}" >> CHANGELOG.md
- name: Commit Changelog
Expand All @@ -54,27 +69,13 @@ jobs:
branch: main
message: ':robot: using action to produce changelog'
add: 'CHANGELOG.md'

- name: Release on Powershell Gallery
shell: pwsh
run: |
$ModuleVersion = "${{github.ref_name}}" -replace ('[a-zA-Z\-]', '')
Update-ModuleManifest -Path ./BioNameGenerator/BioNameGenerator.psd1 -ModuleVersion $ModuleVersion
Publish-Module -Path ./BioNameGenerator -NuGetApiKey ${{ secrets.PSGALLERY_KEY }}
- name: Generate a release name
shell: pwsh
id: gen_release
run: |
Install-Module BioNameGenerator
$VersionName = $(Get-RandomPhrase -Start Aminoacids -Middle Brazilian -End Species -Delimiter " ").ToLower()
echo "::set-output name=random_name::$VersionName"

- name: Release on Github
uses: ncipollo/release-action@v1
with:
name: "${{github.ref_name}} - ${{ steps.gen_release.outputs.random_name}}"
name: "${{github.ref_name}}"
artifacts: "LICENSE,CHANGELOG.md"
body: ${{ steps.modified.outputs.modified }}
bodyFile: "release_body.md"
token: ${{ secrets.GITHUB_TOKEN }}


Expand Down

0 comments on commit b093352

Please sign in to comment.