Fix for #355 - Remove quotes in release description (#367) #119
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
deploy: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Get current date | |
id: date | |
run: echo "::set-output name=date::$(date +'%Y-%m-%d-%H-%M')" | |
- name: Extract information from CHANGELOG.md | |
id: extract_changelog | |
shell: bash | |
run: | | |
res=$'' | |
changelog="$(cat CHANGELOG.md)" | |
while read -r line; do | |
if [[ "$line" =~ ^##[[:space:]][[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+ ]]; then | |
if [ -z "$version" ]; then | |
version=${line:2} | |
else | |
break | |
fi | |
else | |
if [ ! -z "$version" ]; then | |
res+="${line//\r@Q}\n" | |
fi | |
fi | |
done < CHANGELOG.md | |
echo -e "version<<EOF"$'\n'"$version"$'\n'EOF >> $GITHUB_OUTPUT | |
echo -e "body<<EOF"$'\n'$res$'\n'EOF >> $GITHUB_OUTPUT | |
- run: vcpkg integrate install | |
- uses: ilammy/[email protected] | |
with: | |
arch: x86 | |
- name: Compile FLHook | |
run: msbuild.exe "${env:GITHUB_WORKSPACE}\project\FLHook.sln" /t:Build /p:Configuration=Release /p:Platform=Win32 | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.date.outputs.date }} | |
release_name: "${{ steps.extract_changelog.outputs.version }} | ${{ steps.date.outputs.date }}" | |
body: | | |
${{ steps.extract_changelog.outputs.body }} | |
draft: false | |
prerelease: false | |
- name: Remove .pdb files | |
run: | | |
del /S *.pdb | |
shell: cmd | |
- name: Remove template .dll | |
run: | | |
del /S $safeprojectname$.dll | |
shell: cmd | |
- name: Zip dlls | |
run: | | |
powershell Compress-Archive -Path .\dist\Release -DestinationPath .\Release.zip | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./Release.zip | |
asset_name: Release.zip | |
asset_content_type: application/zip | |