Compare commits

..

No commits in common. "2aa8b235ee2d6c510df4c3a59555cc104d8dd234" and "6766eb14f3298a53f4a0ebcc0e2d0b0209a7c6b2" have entirely different histories.

10 changed files with 25 additions and 157 deletions

1
.gitignore vendored
View File

@ -9,4 +9,3 @@ shard.lock
.vscode/ .vscode/
.crystal/ .crystal/
venv/ venv/
.croupier

3
.md.rb
View File

@ -1,3 +0,0 @@
exclude_rule 'MD033' # Inline HTML
exclude_rule 'MD005' # 3-space indent for lists
exclude_rule 'MD024' # Repeated headings

1
.mdlrc
View File

@ -1 +0,0 @@
style ".md.rb"

View File

@ -2,29 +2,12 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## [0.6.4] - 2024-08-28 ## [unreleased]
### 🐛 Bug Fixes
- Ameba
### 📚 Documentation
- Mention AUR package
### ⚙️ Miscellaneous Tasks ### ⚙️ Miscellaneous Tasks
- Pre-commit hooks - Pre-commit hooks
- Git-cliff config - Git-cliff config
- Started changelog
- Force conventional commit messages
- Force conventional commit messages
- Updated pre-commit
### Build
- Switch from Makefile to Hacefile
- Added do_release script
## [0.6.1] - 2024-08-25 ## [0.6.1] - 2024-08-25

View File

@ -1,115 +0,0 @@
variables:
FLAGS: "-d --error-trace"
NAME: "tartrazine"
tasks:
build:
default: true
dependencies:
- src
- shard.lock
- shard.yml
- Hacefile.yml
- lexers/*xml
- styles/*xml
outputs:
- bin/{{NAME}}
commands: |
shards build {{FLAGS}}
get-deps:
dependencies:
- shard.yml
outputs:
- shard.lock
commands: |
shards install
build-release:
phony: true
always_run: true
commands: |
hace build FLAGS="--release"
install:
phony: true
always_run: true
dependencies:
- bin/hace
commands: |
rm ${HOME}/.local/bin/{{name}}
cp bin/hace ${HOME}/.local/bin/{{name}}
static:
outputs:
- bin/{{name}}-static-linux-amd64
- bin/{{name}}-static-linux-arm64
commands: |
hace clean
./build_static.sh
test:
dependencies:
- src
- spec
- shard.lock
- shard.yml
commands: |
crystal spec -v --error-trace
phony: true
always_run: true
lint:
dependencies:
- src
- spec
- shard.lock
- shard.yml
commands: |
crystal tool format src/*.cr spec/*.cr
ameba --fix
always_run: true
phony: true
docs:
dependencies:
- src
- shard.lock
- shard.yml
- README.md
commands: |
crystal docs
outputs:
- docs/index.html
pre-commit:
default: true
outputs:
- .git/hooks/commit-msg
- .git/hooks/pre-commit
dependencies:
- .pre-commit-config.yaml
commands: |
pre-commit install --hook-type commit-msg
pre-commit install
clean:
phony: true
always_run: true
commands: |
rm -rf shard.lock bin lib
coverage:
dependencies:
- src
- spec
- shard.lock
- shard.yml
commands: |
shards install
crystal build -o bin/run_tests src/run_tests.cr
rm -rf coverage/
mkdir coverage
kcov --clean --include-path=./src ${PWD}/coverage ./bin/run_tests
outputs:
- coverage/index.html

21
Makefile Normal file
View File

@ -0,0 +1,21 @@
all: build
build: $(wildcard src/**/*.cr) $(wildcard lexers/*xml) $(wildcard styles/*xml) shard.yml
shards build -Dstrict_multi_assign -Dno_number_autocast -d --error-trace
release: $(wildcard src/**/*.cr) $(wildcard lexers/*xml) $(wildcard styles/*xml) shard.yml
shards build --release
static: $(wildcard src/**/*.cr) $(wildcard lexers/*xml) $(wildcard styles/*xml) shard.yml
shards build --release --static
strip bin/tartrazine
clean:
rm -rf bin lib shard.lock
test:
crystal spec
lint:
ameba --fix src spec
.PHONY: clean all test bin lint

View File

@ -7,10 +7,10 @@ docker run --rm --privileged \
# Build for AMD64 # Build for AMD64
docker build . -f Dockerfile.static -t tartrazine-builder docker build . -f Dockerfile.static -t tartrazine-builder
docker run -ti --rm -v "$PWD":/app --user="$UID" tartrazine-builder /bin/sh -c "cd /app && rm -rf lib shard.lock && shards build --static --release" docker run -ti --rm -v "$PWD":/app --user="$UID" tartrazine-builder /bin/sh -c "cd /app && rm -rf lib shard.lock && make static"
mv bin/tartrazine bin/tartrazine-static-linux-amd64 mv bin/tartrazine bin/tartrazine-static-linux-amd64
# Build for ARM64 # Build for ARM64
docker build . -f Dockerfile.static --platform linux/arm64 -t tartrazine-builder docker build . -f Dockerfile.static --platform linux/arm64 -t tartrazine-builder
docker run -ti --rm -v "$PWD":/app --platform linux/arm64 --user="$UID" tartrazine-builder /bin/sh -c "cd /app && rm -rf lib shard.lock && shards build --static --release" docker run -ti --rm -v "$PWD":/app --platform linux/arm64 --user="$UID" tartrazine-builder /bin/sh -c "cd /app && rm -rf lib shard.lock && make static"
mv bin/tartrazine bin/tartrazine-static-linux-arm64 mv bin/tartrazine bin/tartrazine-static-linux-arm64

View File

@ -1,15 +0,0 @@
#!/bin/bash
set e
PKGNAME=$(basename "$PWD")
VERSION=$(git cliff --bumped-version |cut -dv -f2)
sed "s/^version:.*$/version: $VERSION/g" -i shard.yml
git add shard.yml
hace lint test
git cliff --bump -o
git commit -a -m "bump: Release v$VERSION"
git tag "v$VERSION"
git push --tags
hace static
gh release create "v$VERSION" "bin/$PKGNAME-static-linux-amd64" "bin/$PKGNAME-static-linux-arm64" --title "Release v$VERSION" --notes "$(git cliff -l -s all)"

View File

@ -1,5 +1,5 @@
name: tartrazine name: tartrazine
version: 0.6.4 version: 0.6.3
authors: authors:
- Roberto Alsina <roberto.alsina@gmail.com> - Roberto Alsina <roberto.alsina@gmail.com>

View File

@ -1 +0,0 @@
require "../spec/**"