From a7bf61033e1e320c2f5992815d077450271cf62a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Kr=C3=BCger?= Date: Mon, 22 Apr 2024 13:48:24 +0200 Subject: [PATCH] Added python script for file_id preparation. --- .github/workflows/build.yml | 36 ++++++------------------------- README.md | 15 ++++++++++++- crates/icy_draw/build/file_id.diz | 22 +++++++++++++++++-- crates/icy_play/Cargo.toml | 2 +- crates/icy_view/build/file_id.diz | 3 ++- tools/prep_diz.py | 26 ++++++++++++++++++++++ 6 files changed, 69 insertions(+), 35 deletions(-) create mode 100644 tools/prep_diz.py diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0425c0f..9b2e890 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,12 +17,7 @@ jobs: - uses: actions/checkout@v3 - name: Prepare FILE_ID.DIZ run: | - $env:Path += ";C:\Program Files\Git\usr\bin" - Get-Command sed - Get-Command grep - - $VERSION=$(grep "^version\s*=" file_id.diz + $VERSION=$(python tools\prep_diz.py ".\crates\${{ matrix.app }}\" "file_id.diz") echo "Version: $VERSION" Add-Content -Path $env:GITHUB_ENV -Value "VERSION=$VERSION" @@ -31,31 +26,12 @@ jobs: run: | cd .\crates\${{ matrix.app }} cargo build --release + cd ..\.. + move .\target\release\${{ matrix.app }}.exe . - name: 'Upload executable' uses: actions/upload-artifact@v3 with: - name: ${{ matrix.app }}_${{ env.VERSION }}_windows_exe + name: ${{ matrix.app }}_${{ env.VERSION }}_windows path: | - .\target\release\${{ matrix.app }}.exe - file_id.diz - -# - name: Build MSI installer. -# shell: pwsh -# env: -# PFX_CONTENT: ${{ secrets.WINDOWS_CERTIFICATE_BASE64 }} -# run: | -# dotnet tool install --global wix --version 4.0.1 -# $encodedBytes=[System.Convert]::FromBase64String($env:PFX_CONTENT); -# Set-Content "./cert.pfx" -Value $encodedBytes -# echo "Building ${{ env.VERSION }} installer…" -# wix extension add WixToolset.UI.wixext WixToolset.Util.wixext -# wix build -arch "x64" -ext WixToolset.UI.wixext -ext WixToolset.Util.wixext -d "PATH=./cert.pfx" -d "VERSION=${{ env.VERSION }}" -out "./${{ env.APP_NAME }}-${{ env.VERSION }}-installer.msi" "build/windows/installer.wxs" -# del "./cert.pfx" -# - name: 'Upload Artifact' -# id: upload_msi -# uses: actions/upload-artifact@v3 -# with: -# name: ${{ matrix.app }}_${{ env.VERSION }}_windows_msi -# path: | -# ${{ matrix.app }}-${{ env.VERSION }}-installer.msi -# file_id.diz + ${{ matrix.app }}.exe + file_id.diz \ No newline at end of file diff --git a/README.md b/README.md index 9612061..fbca36e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,15 @@ # icy_tools -Tools for ansi/ascii/bbsing + +This repository contains tools releated to BBSing and Ansi in general. It contains: + +[Icy Term](https://github.com/mkrueger/icy_tools/blob/master/crates/icy_term/README.md) +a terminal program for legacy BBS systems. + +[Icy Draw](https://github.com/mkrueger/icy_tools/blob/master/crates/icy_draw/README.md) +a drawing tool supporting almost all ANSI formats. + +[Icy View](https://github.com/mkrueger/icy_tools/blob/master/crates/icy_view/README.md) +a viewer to browse/view Ansi screens. + +[Icy Play](https://github.com/mkrueger/icy_tools/blob/master/crates/icy_play/README.md) +a tool that shows icy draw animations on cmd line/bbs. \ No newline at end of file diff --git a/crates/icy_draw/build/file_id.diz b/crates/icy_draw/build/file_id.diz index 77fac56..eac1cbd 100644 --- a/crates/icy_draw/build/file_id.diz +++ b/crates/icy_draw/build/file_id.diz @@ -1,8 +1,26 @@ -* ICY DRAW #VERSION *- ANSI drawing tool. -Supports: Everything, if it doesn't support -something it'll get implemented :). + +- Written in pure rust +- Own new file fomat: .icy + based on .png (previews in file browser) +- Supports Ansi, Ascii, Artworx ADF, + Avatar, BIN, XBIN, PCBoard, iCE, + Tundra Draw, CtrlA & Renegade files +- Multi platform Windows, OSX, Linux +- Supports multiple drawing layers +- Brushes, fills, rectangles, halfblock support +- Palette support +- Multi window +- 3D accelerated +- Own animation system + animated GIF output +- TheDraw Font support +- Multiple Bitfont support +- PNG export +- Sauce +- Color modes from classic to full RGB/iCE +- Plugin support Development GitHub https://github.com/mkrueger/icy_tools \ No newline at end of file diff --git a/crates/icy_play/Cargo.toml b/crates/icy_play/Cargo.toml index fe745bc..3b2b2fb 100644 --- a/crates/icy_play/Cargo.toml +++ b/crates/icy_play/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "icy_play" -version.workspace = true +version = "0.2.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/crates/icy_view/build/file_id.diz b/crates/icy_view/build/file_id.diz index 660e386..fb8c5cb 100644 --- a/crates/icy_view/build/file_id.diz +++ b/crates/icy_view/build/file_id.diz @@ -4,7 +4,8 @@ A cross platform ansi art viewer. - Supports Ansi, Ascii, Artworx ADF, Avatar, BIN, XBIN, PCBoard, iCE, - Tundra Draw + Tundra Draw, RipScript, C64 SEQ, + IcyDraw - Various picture formats - Can open zip files directly diff --git a/tools/prep_diz.py b/tools/prep_diz.py new file mode 100644 index 0000000..9961cb8 --- /dev/null +++ b/tools/prep_diz.py @@ -0,0 +1,26 @@ +import sys + +if len(sys.argv) != 3: + print("need 2 arguments") + sys.exit(1) + +version="" +cargo = open(sys.argv[1] + "Cargo.toml", "r") +for line in cargo.readlines(): + if line.startswith("version"): + m = line.index('"') + version = line[m + 1:len(line) - 2] + break +cargo.close() + +file_id = open(sys.argv[1] + "/build/file_id.diz", "r") +lines = file_id.readlines() +file_id.close() + +new_lines = list(map(lambda line: line.replace("#VERSION", version), lines)) + +f = open(sys.argv[2], "w") +f.writelines(new_lines) +f.close() + +print(version)