diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5345002 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,69 @@ +on: + push: + tags: + - "v*" + +name: Release + +jobs: + # cargo_publish: + # name: Publish to crates.io + # steps: + # - name: Checkout + # uses: actions/checkout@v4 + # - name: Publish + # run: cargo publish --locked --token ${{ secrets.CRATES_IO_TOKEN }} + + create_release: + name: Create draft release + runs-on: ubuntu-latest + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Create draft release + run: gh release create ${{ github.ref_name }} --notes-file CHANGELOG.md --draft + + build: + name: Build binaries + needs: create_release + runs-on: ${{ matrix.os }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ARCHIVE_NAME: fixit-${{ github.ref_name }}-${{ matrix.target }} + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + target: aarch64-unknown-linux-musl + - os: ubuntu-latest + target: x86_64-unknown-linux-musl + - os: macos-latest + target: x86_64-apple-darwin + - os: macos-latest + target: aarch64-apple-darwin + steps: + - name: Install Rust target + run: rustup target add ${{ matrix.target }} + - name: Checkout + uses: actions/checkout@v4 + - name: Build + run: cargo build --release --locked --target ${{ matrix.target }} + - name: Create archive + run: mv ./target/${{ matrix.target }}/release/fixit . && tar -czvf $ARCHIVE_NAME.tar.gz fixit + - name: Checksum + run: sha256sum $ARCHIVE_NAME.tar.gz > $ARCHIVE_NAME.sha256 + - name: Upload artifacts + run: gh release upload ${{ github.ref_name }} $ARCHIVE_NAME.{tar.gz,sha256} + + publish_release: + name: Publish release + runs-on: ubuntu-latest + needs: build + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Publish release + run: gh release edit ${{ github.ref_name }} --draft=false diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b25f47d..52b272d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,7 +11,7 @@ jobs: run: npm install -g prettier - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Run cargo fmt run: cargo fmt --check diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..b32706f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to +[Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## v0.1.0-alpha + +## Added + +- Initial release diff --git a/Cargo.lock b/Cargo.lock index 9508a65..3aef936 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -238,7 +238,7 @@ checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "fixit" -version = "0.1.0-alpha" +version = "0.1.0-alpha.1" dependencies = [ "clap", "ctrlc", diff --git a/Cargo.toml b/Cargo.toml index 10559f5..2b2a86b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,14 @@ [package] name = "fixit" -version = "0.1.0-alpha" +version = "0.1.0-alpha.1" edition = "2021" license = "MIT" authors = [ "Yevhenii Babichenko " ] homepage = "https://github.com/eugene-babichenko/fixit" +repository = "https://github.com/eugene-babichenko/fixit" +readme = "README.md" +categories = [ "command-line-utilities" ] +description = "A utility to fix mistakes in your commands." [dependencies] clap = { version = "4", features = ["derive", "env"] } diff --git a/README.md b/README.md index 56ad982..c09f931 100644 --- a/README.md +++ b/README.md @@ -91,8 +91,9 @@ Environment variables: re-running the given command. This is generally much faster, so it is recommended that you leave it as is unless you run into any bugs associated with finding fixes. The combination that can be potentially buggy is - suppported terminal emulator with unsupported multiplexer. The default value - is `true`. Pass `false` to disable. + suppported terminal emulator with unsupported multiplexer when the failed + command is not visible on the screen. The default value is `true`. Pass + `false` to disable. - `FIXIT_QUICK_SEARCH_DEPTH` sets the number of lines to get from the scrollback buffer in addition to what we see on the screen. The default is `1000`.