Skip to content

Commit

Permalink
feat: rewrite v2
Browse files Browse the repository at this point in the history
  • Loading branch information
arexon committed Sep 21, 2024
1 parent 4b771f8 commit 38631c5
Show file tree
Hide file tree
Showing 67 changed files with 2,676 additions and 604 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
Binary file removed .github/diagram.png
Binary file not shown.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

env:
CARGO_TERM_COLOR: always

jobs:
ci:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Rust Toolchain
run: |
rustup toolchain install stable --profile minimal
rustup component add clippy
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2

- name: Build
run: cargo build --verbose --locked

- name: Test
run: cargo test --verbose

- name: Clippy
run: cargo clippy -- -Dwarnings
103 changes: 103 additions & 0 deletions .github/workflows/draft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Draft

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

jobs:
build-unix:
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: x86_64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Rust Toolchain
run: rustup toolchain install stable --profile minimal --target ${{ matrix.target }}

- name: Build
run: |
cargo build --release --locked --target ${{ matrix.target }}
- name: Pack artifact
env:
ARTIFACT_NAME: haze-${{ matrix.target }}
run: |
mkdir "$ARTIFACT_NAME"
cp "target/${{ matrix.target }}/release/haze" "$ARTIFACT_NAME"
cp README.md LICENSE "$ARTIFACT_NAME"
if ! command -v zip &> /dev/null
then
sudo apt-get update && sudo apt-get install -yq zip
fi
zip -r "$ARTIFACT_NAME.zip" "$ARTIFACT_NAME"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: haze-${{ matrix.target }}.zip
path: haze-${{ matrix.target }}.zip

build-windows:
strategy:
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Rust Toolchain
run: rustup toolchain install stable --profile minimal

- name: Add target
run: rustup target add ${{ matrix.target }}

- name: Build
run: cargo build --release --locked --target ${{ matrix.target }}

- name: Pack artifact
env:
TARGET_NAME: haze-${{ matrix.target }}
run: |
New-Item -ItemType Directory -Path ${env:TARGET_NAME}
Copy-Item -Path "target\${{ matrix.target }}\release\haze.exe" -Destination ${env:TARGET_NAME}
Copy-Item -Path "README.md", "LICENSE" -Destination ${env:TARGET_NAME}
Compress-Archive -Path ${env:TARGET_NAME} -DestinationPath "${env:TARGET_NAME}.zip"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: haze-${{ matrix.target }}.zip
path: haze-${{ matrix.target }}.zip

draft:
permissions:
contents: write
runs-on: ubuntu-latest
needs: [build-unix, build-windows]
steps:
- name: Grab artifact
uses: actions/download-artifact@v4
with:
merge-multiple: true

- name: Draft
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: haze-*.zip
33 changes: 0 additions & 33 deletions .github/workflows/release.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/target
/.direnv
/result
67 changes: 67 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Changelog

## [2.0.0](https://github.com/salpland/haze/compare/v1.4.0...v2.0.0)

### Changes

- Allow importing and exporting multiple worlds at once
- Fix target worlds not being cleaned up during exporting with the `--overwrite`
flag ([#14](https://github.com/salpland/haze/issues/14))
- Add a pretty printer for `haze list`
- Rename `--path` flag to `--minecraft-version` and restrict setting its value
to `stable`, `preview`, or `education`
- Allow setting `COM_MOJANG` environment variable to define an arbitrary
`com.mojang` path
- Merge `haze_core` and `haze` into a single crate
- Add colored help message for `haze help`
- Support using comments in `config.json`
- Provide binaries for Linux and MacOS

## [1.4.0](https://github.com/salpland/haze/compare/v1.3.0...v1.4.0)

### Changes

- Add the `--path` flag to allow using predefined export/import paths to
`com.mojang` or custom ones
([#12](https://github.com/salpland/haze/issues/12))

## [1.3.0](https://github.com/salpland/haze/compare/v1.2.0...v1.3.0)

### Changes

- Add `haze list` subcommand to list the available worlds in the project. By
[@solvedDev](https://github.com/solvedDev)
([#10](https://github.com/salpland/haze/issues/10))
- BREAKING: Rename `test` and `save` subcommands to `export` and `import`
respectively. By [@solvedDev](https://github.com/solvedDev)
([#8](https://github.com/salpland/haze/issues/8))
- Extract the core of Haze into a library. By
[@solvedDev](https://github.com/solvedDev)
([#9](https://github.com/salpland/haze/issues/9))

## [1.2.0](https://github.com/salpland/haze/compare/v1.1.0...v1.2.0)

### Changes

- BREAKING: Use `worlds` property in the configuration
([#4](https://github.com/salpland/haze/issues/4))
- Improve error and logging messages
- Use less bold text for errors
- Update the descriptions for some commands
- Remove diagnostic codes

## [1.1.0](https://github.com/salpland/haze/compare/v1.0.1...v1.1.0)

### Changes

- Disable overwriting in `haze test` by default
([#1](https://github.com/salpland/haze/issues/1))
- Add `--overwrite` flag to `haze test` to enable overwriting
([#2](https://github.com/salpland/haze/issues/2))
- Improve error/info messages ([#3](https://github.com/salpland/haze/issues/2))

## [1.0.1](https://github.com/salpland/haze/compare/v1.0.0...v1.0.1)

### Changes

- Update the project's description for more clarity
Loading

0 comments on commit 38631c5

Please sign in to comment.