|
@ -301,22 +301,30 @@ jobs: |
|
|
"$($_.Name) $((Get-FileHash -LiteralPath $_.FullName -Algorithm SHA256).Hash)" |
|
|
"$($_.Name) $((Get-FileHash -LiteralPath $_.FullName -Algorithm SHA256).Hash)" |
|
|
} | Add-Content -Path SHA256SUM -Encoding Default -Force |
|
|
} | Add-Content -Path SHA256SUM -Encoding Default -Force |
|
|
|
|
|
|
|
|
- name: Upload archives to release |
|
|
- name: ReleaseNotesTemplate |
|
|
uses: svenstaro/upload-release-action@master |
|
|
id: read_release |
|
|
with: |
|
|
run: | |
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }} |
|
|
$Parameters = @{ |
|
|
file: Sophia*.zip |
|
|
Uri = "https://api.github.com/repos/farag2/Sophia-Script-for-Windows/releases" |
|
|
tag: ${{ github.ref }} |
|
|
UseBasicParsing = $true |
|
|
overwrite: true |
|
|
Verbose = $true |
|
|
file_glob: true |
|
|
} |
|
|
prerelease: true |
|
|
$Penultimate = (Invoke-RestMethod @Parameters).tag_name | Select-Object -Index 1 |
|
|
|
|
|
|
|
|
- name: Upload archives to release |
|
|
# https://en.wikipedia.org/wiki/Percent-encoding |
|
|
uses: svenstaro/upload-release-action@master |
|
|
$Release = (Get-Content -Path ReleaseNotesTemplate.md -Encoding utf8 -Raw).replace("%", "%25").replace("`n", "%0A").replace("`r", "%0D").replace("NewVersion", "${{ github.ref_name }}").replace("OldVersion", $Penultimate) |
|
|
|
|
|
|
|
|
|
|
|
# https://trstringer.com/github-actions-multiline-strings/ |
|
|
|
|
|
echo "::set-output name=RELEASE_BODY::$Release" |
|
|
|
|
|
$ReleaseName = Get-Date -f "dd.MM.yyyy" |
|
|
|
|
|
echo "RELEASE_NAME=$ReleaseName" >> $env:GITHUB_ENV |
|
|
|
|
|
|
|
|
|
|
|
- name: Uploading |
|
|
|
|
|
uses: softprops/action-gh-release@master |
|
|
with: |
|
|
with: |
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }} |
|
|
name: ${{ env.RELEASE_NAME }} |
|
|
file: SHA256SUM |
|
|
token: ${{ github.token }} |
|
|
tag: ${{ github.ref }} |
|
|
files: | |
|
|
overwrite: true |
|
|
Sophia*.zip |
|
|
file_glob: true |
|
|
SHA256SUM |
|
|
prerelease: true |
|
|
body: ${{ steps.read_release.outputs.RELEASE_BODY }} |
|
|