Skip to content

Commit

Permalink
Merge pull request #2 from Segilmez06/dev
Browse files Browse the repository at this point in the history
Release 1.0.1
  • Loading branch information
Segilmez06 authored Oct 5, 2023
2 parents 1bcb2d1 + ff65c49 commit 96d560b
Show file tree
Hide file tree
Showing 21 changed files with 1,196 additions and 307 deletions.
62 changes: 34 additions & 28 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,39 @@
name: Debug

on:
push:
branches:
- dev
push:
branches:
- dev

jobs:
debug-build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]

steps:
- uses: actions/checkout@v3

- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'

- name: Build
run: dotnet build src/TYM.csproj

- name: Publish
run: dotnet publish src/TYM.csproj /p:PublishProfile=src/Properties/PublishProfiles/${{ matrix.os }}.pubxml

- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}
path: src/pub/
debug-build:
name: Debug build
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
target: win

- os: ubuntu-latest
target: linux

- os: macos-latest
target: osx

steps:
- uses: actions/checkout@v3

- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'

- name: Build
run: dotnet build src/TYM.csproj

- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: debug-${{ matrix.target }}
path: src/bin/
170 changes: 78 additions & 92 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,97 +1,83 @@
name: Build and draft release
name: Release

on:
push:
branches:
- main
push:
branches:
- main

jobs:

draft-release:
name: Draft new release
runs-on: ubuntu-latest
draft_release:
name: Draft new release
runs-on: ubuntu-latest

outputs:
release_tag: ${{ steps.project_version.outputs.TAG }}

steps:

outputs:
upload_url: ${{ steps.draft_release.outputs.upload_url }}

steps:
- name: Fetch source code
uses: actions/checkout@v3

- name: Install XML tools
run: sudo apt install xmlstarlet

- name: Fetch version string
run: echo "TAG=$(xmlstarlet select --template --value-of /Project/PropertyGroup/AssemblyVersion ./src/TYM.csproj)" >> $GITHUB_OUTPUT
id: version

- name: Draft release
uses: actions/create-release@v1
id: draft_release
env:
GITHUB_TOKEN: ${{ secrets.G_TOKEN }}
with:
tag_name: ${{ steps.version.outputs.TAG }}
release_name: TYM v${{ steps.version.outputs.TAG }}
draft: true
prerelease: false


release-assets:
name: Build and upload release assets
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]

steps:
- name: Fetch source code
uses: actions/checkout@v3

- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'

- name: Fetch version string (win)
run: echo "TAG=$(./src/pub/TYM.exe --version | cut -c5- )" >> $GITHUB_OUTPUT
id: version
shell: bash
if: matrix.os == 'windows-latest'

- name: Fetch version string (*nix)
run: echo "TAG=$(./src/pub/TYM --version | cut -c5- )" >> $GITHUB_OUTPUT
id: version
shell: bash
if:
matrix.os == 'macos-latest'
matrix.os == 'ubuntu-latest'

- name: Build
run: dotnet build src/TYM.csproj

- name: Publish
run: dotnet publish src/TYM.csproj /p:PublishProfile=src/Properties/PublishProfiles/${{ matrix.os }}.pubxml

- name: Upload release assets (win)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.G_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_name: TYM-${{ steps.version.outputs.TAG }}-${{ matrix.os }}
asset_path: ./src/pub/TYM.exe
asset_content_type: application/octet-stream
if: matrix.os == 'windows-latest'

- name: Upload release assets (*nix)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.G_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_name: TYM-${{ steps.version.outputs.TAG }}-${{ matrix.os }}
asset_path: ./src/pub/TYM
asset_content_type: application/octet-stream
if: matrix.os == 'windows-latest'
- name: Fetch source code
uses: actions/checkout@v3

- name: Install XML tools
run: sudo apt install xmlstarlet

- name: Fetch version string
run: echo "TAG=$(xmlstarlet select --template --value-of /Project/PropertyGroup/AssemblyVersion ./src/TYM.csproj)" >> $GITHUB_OUTPUT
id: project_version

- name: Draft release
uses: softprops/action-gh-release@v1
id: draft
env:
GITHUB_TOKEN: ${{ secrets.G_TOKEN }}
with:
tag_name: ${{ steps.project_version.outputs.TAG }}
name: TYM v${{ steps.project_version.outputs.TAG }}
draft: true
prerelease: false
body_path: CHANGELOG.md


build_artifacts:
name: Build release assets
runs-on: ${{ matrix.os }}
needs: draft_release

strategy:
matrix:
include:
- os: windows-latest
target: win
bin-extension: ".exe"

- os: ubuntu-latest
target: linux
bin-extension: ""

- os: macos-latest
target: osx
bin-extension: ""

steps:

- name: Fetch source code
uses: actions/checkout@v3

- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'

- name: Build
run: dotnet build src/TYM.csproj

- name: Publish
run: dotnet publish src/TYM.csproj -a x64 --os ${{ matrix.target }} -c Release -p:PublishProfile=Properties/PublishProfiles/PublishConfig.pubxml

- name: Rename output files
run: mv src/pub/TYM${{ matrix.bin-extension }} TYM-${{ needs.draft_release.outputs.release_tag }}-${{ matrix.target }}-bin${{ matrix.bin-extension }}

- name: Upload artifact
run: gh release upload ${{ needs.draft_release.outputs.release_tag }} TYM-${{ needs.draft_release.outputs.release_tag }}-${{ matrix.target }}-bin${{ matrix.bin-extension }}
env:
GH_TOKEN: ${{ secrets.G_TOKEN }}
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Changelog

## General

- [x] Optimize code and fragment info methods
- [x] Fix workflows (publishing)
- [x] Move settings to embedded resource
- [x] Optimize web requests
- [x] Create console logging utility

## CLI Args

- [x] Clear web download cache
15 changes: 0 additions & 15 deletions Changelog.md

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 🍉 TYM
[![Debug build](https://github.com/Segilmez06/tym/actions/workflows/debug.yml/badge.svg)](https://github.com/Segilmez06/EFI-Runner/actions/workflows/debug.yml)
[![Release build](https://github.com/Segilmez06/tym/actions/workflows/release.yml/badge.svg)](https://github.com/Segilmez06/EFI-Runner/actions/workflows/release.yml)
[![Debug build](https://github.com/Segilmez06/tym/actions/workflows/debug.yml/badge.svg)](https://github.com/Segilmez06/tym/actions/workflows/debug.yml)
![GitHub release](https://img.shields.io/github/v/release/Segilmez06/tym?label=Release)

TYM is a cross-platform tool that renders image files in your terminal. It uses VT100 escape codes to display 24-bit true color images.

Expand Down
5 changes: 4 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

## General

- [ ] Optimize code and fragment info methods
- [x] Optimize code and fragment info methods
- [ ] Localization
- [ ] ~~Add web link caching with hash checking~~

## CLI Args

- [ ] Open web cache directory in explorer
15 changes: 15 additions & 0 deletions src/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="TYM.Config" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<applicationSettings>
<TYM.Config>
<setting name="SupportedImageMimeTypes" serializeAs="String">
<value>jpeg;bmp;gif;png;tiff;webp</value>
</setting>
</TYM.Config>
</applicationSettings>
</configuration>
Loading

0 comments on commit 96d560b

Please sign in to comment.