stop spamming the god damn logs #205
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: .NET | |
on: | |
push: | |
branches: | |
- psqldeko | |
jobs: | |
build: | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # This ensures all history is fetched | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: 8.0.300 | |
- name: Restore dependencies Mewdeko | |
run: dotnet restore src/Mewdeko/Mewdeko.csproj | |
- name: Build Mewdeko | |
run: dotnet publish src/Mewdeko/Mewdeko.csproj --no-restore -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:PublishTrimmed=false -p:IncludeNativeLibrariesForSelfExtract=true -p:UseAppHost=true -o output/ | |
- name: Test | |
run: dotnet test --no-restore --verbosity normal | |
- name: Zip artifacts | |
run: | | |
cd output | |
find . -name "*.pdb" -delete | |
zip -r ../MewdekoPsql-win64.zip . | |
- name: Get current date | |
id: get_date | |
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | |
- name: Get previous tag | |
id: prev_tag | |
run: | | |
echo "prev_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo '')" >> $GITHUB_ENV | |
- name: Get commit messages with links | |
id: commit_messages | |
run: | | |
if [ -z "${{ env.prev_tag }}" ]; then | |
echo 'messages<<EOF' >> $GITHUB_ENV | |
git log -1 --pretty=format:"* [%h](https://github.com/${{ github.repository }}/commit/%H) %s" >> $GITHUB_ENV | |
echo '' >> $GITHUB_ENV | |
echo 'EOF' >> $GITHUB_ENV | |
else | |
echo 'messages<<EOF' >> $GITHUB_ENV | |
git log --pretty=format:"* [%h](https://github.com/${{ github.repository }}/commit/%H) %s" ${{ env.prev_tag }}..HEAD >> $GITHUB_ENV | |
echo '' >> $GITHUB_ENV | |
echo 'EOF' >> $GITHUB_ENV | |
fi | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: psqldeko-${{ github.run_number }} | |
release_name: PsqlDeko build ${{ github.run_number }} (${{ env.date }}) | |
body: | | |
Automated psql build for commit ${{ github.sha }} | |
# WARNING: Mewdeko on PSQL is in early beta and has missing features. If you find bugs please report them. | |
## Commits since previous release: | |
${{ env.messages }} | |
draft: false | |
prerelease: true | |
- name: 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: ./MewdekoPsql-win64.zip | |
asset_name: MewdekoPsql-win64.zip | |
asset_content_type: application/zip |