ci: Use GITHUB_OUTPUT envvar instead of set-output command #62
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: Stable Build | ||
on: | ||
push: | ||
tags: | ||
- "*" | ||
jobs: | ||
build: | ||
name: Build | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 1 | ||
submodules: true | ||
- name: Remove Strawberry Perl from PATH | ||
run: | | ||
$env:PATH = $env:PATH -replace "C:\\Strawberry\\c\\bin;", "" | ||
"PATH=$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Append | ||
- name: Get tags for release notes | ||
shell: bash | ||
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
- name: Build | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake .. -DBUILD_INFO_DUMP=OFF -DBUILD_SPEL2_DLL=OFF | ||
cmake --build . --config Release --target ALL_BUILD | ||
- name: Get the version | ||
id: get_version | ||
run: echo "VERSION=${GITHUB_REF/refs\/tags\//} " >> "$GITHUB_OUTPUT" | ||
shell: bash | ||
- name: Get release notes | ||
id: get_message | ||
shell: bash | ||
run: | | ||
content=$(git show -s --format=%s $(git describe) | tail -n +4 | head -n -1 | sed 's/^/- /') | ||
content="${content//'%'/'%25'}" | ||
content="${content//$'\n'/'%0A'}" | ||
content="${content//$'\r'/'%0D'}" | ||
echo $content | ||
echo "NOTES=$content" >> "$GITHUB_OUTPUT" | ||
- name: Create artifacts | ||
run: | | ||
mkdir Overlunky | ||
move build\bin\Release\Overlunky.dll Overlunky\Overlunky.dll | ||
move build\bin\Release\Overlunky.exe Overlunky\Overlunky.exe | ||
move README.md Overlunky\README.txt | ||
move examples Overlunky\Scripts | ||
7z a Overlunky_${{ steps.get_version.outputs.VERSION }}.zip Overlunky\ | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Binary | ||
path: ./Overlunky | ||
- name: Create release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: "*.zip" | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Notify Discord | ||
uses: rjstone/discord-webhook-notify@v1 | ||
with: | ||
severity: info | ||
color: "#3377ff" | ||
description: "Release notes: ```${{ steps.get_message.outputs.NOTES }}```" | ||
details: "Download: **[Overlunky ${{ steps.get_version.outputs.VERSION }}](https://github.com/spelunky-fyi/overlunky/releases/download/${{ steps.get_version.outputs.VERSION }}/Overlunky_${{ steps.get_version.outputs.VERSION }}.zip)**" | ||
text: A new version of Overlunky was just released! | ||
footer: I thought you'd like to know :3 | ||
webhookUrl: https://canary.discord.com/api/webhooks/${{ secrets.WEBHOOK_ID }}/${{ secrets.WEBHOOK_TOKEN }} |