Skip to content

Commit

Permalink
Added python script for file_id preparation.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrueger committed Apr 22, 2024
1 parent 69bab92 commit a7bf610
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 35 deletions.
36 changes: 6 additions & 30 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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*=" <crates/${{ matrix.app }}/Cargo.toml | sed -n 's/^version\s*=\s*\"//p' | sed -n 's/"//p')
sed "s/#VERSION/$version/g" <.\crates\${{ matrix.app }}\build\file_id.diz >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"
Expand All @@ -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
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.
22 changes: 20 additions & 2 deletions crates/icy_draw/build/file_id.diz
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion crates/icy_play/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "icy_play"
version.workspace = true
version = "0.2.0"
authors.workspace = true
edition.workspace = true
license.workspace = true
Expand Down
3 changes: 2 additions & 1 deletion crates/icy_view/build/file_id.diz
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
26 changes: 26 additions & 0 deletions tools/prep_diz.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit a7bf610

Please sign in to comment.