From 23bf459ad76d51f45dc7c7525ad6f92b38ed97be Mon Sep 17 00:00:00 2001 From: Haruaki Tamada Date: Wed, 5 Nov 2025 12:06:12 +0900 Subject: [PATCH 1/5] refactor: replace action-gh-release with gh CLI for creating releases and uploading assets --- .github/workflows/publish.yaml | 36 +++++++++++++++++----------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 082a9c0..1fb5353 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -14,7 +14,6 @@ jobs: outputs: appname: gixor tag: ${{ steps.vars.outputs.tag }} - upload_url: ${{ steps.create_release.outputs.upload_url }} steps: - name: Git Tag name id: vars @@ -24,12 +23,12 @@ jobs: - name: Create release id: create_release - uses: softprops/action-gh-release@v2 - with: - tag_name: v${{ steps.vars.outputs.tag }} - name: Release v${{ steps.vars.outputs.tag }} - draft: true - prerelease: false + run: | + gh release create v${{ steps.vars.outputs.tag }} \ + --draft \ + --repo $GITHUB_REPOSITORY \ + --title "Release v${{ steps.vars.outputs.tag }}" \ + --generate-notes publish: runs-on: ${{ matrix.os }} @@ -136,17 +135,18 @@ jobs: cp -r README.md LICENSE assets dist/$DIST/$DIR cp target/${{ matrix.target }}/release/${{ matrix.artifact_name }}-cli dist/$DIST/$DIR/${{ matrix.artifact_name }} tar cvfz dist/${{ matrix.asset_name }}.tar.gz -C dist/$DIST $DIR + gh release upload v${{ needs.setup.outputs.tag }} dist/${{ matrix.asset_name }}.tar.gz --repo $GITHUB_REPOSITORY - - name: Upload release assets - id: upload-release-assets - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - asset_path: dist/${{ matrix.asset_name }}.tar.gz - asset_name: ${{ matrix.asset_name }}.tar.gz - asset_content_type: application/x-gzip - upload_url: ${{ needs.setup.outputs.upload_url }} + # - name: Upload release assets + # id: upload-release-assets + # uses: actions/upload-release-asset@v1.0.1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # asset_path: dist/${{ matrix.asset_name }}.tar.gz + # asset_name: ${{ matrix.asset_name }}.tar.gz + # asset_content_type: application/x-gzip + # upload_url: ${{ needs.setup.outputs.upload_url }} docker: needs: publish @@ -194,7 +194,7 @@ jobs: cache-from: type=registry,ref=ghcr.io/${{ github.repository}}:buildcache cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache,mode=max - release: + finalize_release: needs: publish runs-on: ubuntu-latest steps: From 40bce1b25b2df3176a69c892c7989fcc9a3d0b2d Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 5 Nov 2025 03:06:29 +0000 Subject: [PATCH 2/5] update version to 0.4.1, ready to publish v0.4.1 --- Cargo.toml | 2 +- Dockerfile | 2 +- README.md | 4 ++-- docs/content/_index.md | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5760b0a..81e6fa8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ members = [ resolver = "3" [workspace.package] -version = "0.4.0" +version = "0.4.1" edition = "2021" authors = [ "Haruaki Tamada" ] license-file = "LICENSE" diff --git a/Dockerfile b/Dockerfile index 79f38d5..fe940e3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,7 @@ RUN cargo build --release \ FROM debian:bullseye-slim -ARG VERSION=0.4.0 +ARG VERSION=0.4.1 LABEL org.opencontainers.image.source=https://github.com/tamada/gixor \ org.opencontainers.image.version=${VERSION} \ diff --git a/README.md b/README.md index 4492253..a86d014 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,10 @@ [![Coverage Status](https://coveralls.io/repos/github/tamada/gixor/badge.svg?branch=main)](https://coveralls.io/github/tamada/gixor?branch=main) [![Rust Report Card](https://rust-reportcard.xuri.me/badge/github.com/tamada/gixor)](https://rust-reportcard.xuri.me/report/github.com/tamada/gixor) -[![Version](https://img.shields.io/badge/Version-v0.4.0-green)](https://github.com/tamada/gixor/releases/tag/v0.4.0) +[![Version](https://img.shields.io/badge/Version-v0.4.1-green)](https://github.com/tamada/gixor/releases/tag/v0.4.1) [![License](https://img.shields.io/badge/License-MIT-green)](https://github.com/tamada/gixor/blob/main/LICENSE) -[![Docker](https://img.shields.io/badge/Docker-ghcr.io/tamada/gixor:0.4.0-blue?logo=docker)](https://github.com/tamada/gixor/pkgs/container/gixor/) +[![Docker](https://img.shields.io/badge/Docker-ghcr.io/tamada/gixor:0.4.1-blue?logo=docker)](https://github.com/tamada/gixor/pkgs/container/gixor/) [![Homebrew](https://img.shields.io/badge/Homebrew-tamada/tap/gixor-blue?logo=homebrew)](https://github.com/tamada/homebrew-tap) Git Ignore Management System for Multiple Repositories. diff --git a/docs/content/_index.md b/docs/content/_index.md index 8b5c675..0d881de 100644 --- a/docs/content/_index.md +++ b/docs/content/_index.md @@ -8,10 +8,10 @@ date: 2025-02-25 [![Coverage Status](https://coveralls.io/repos/github/tamada/gixor/badge.svg?branch=main)](https://coveralls.io/github/tamada/gixor?branch=main) [![Rust Report Card](https://rust-reportcard.xuri.me/badge/github.com/tamada/gixor)](https://rust-reportcard.xuri.me/report/github.com/tamada/gixor) -[![Version](https://img.shields.io/badge/Version-v0.4.0-green)](https://github.com/tamada/gixor/releases/tag/v0.4.0) +[![Version](https://img.shields.io/badge/Version-v0.4.1-green)](https://github.com/tamada/gixor/releases/tag/v0.4.1) [![License](https://img.shields.io/badge/License-MIT-green)](https://github.com/tamada/gixor/blob/main/LICENSE) -[![Docker](https://img.shields.io/badge/Docker-ghcr.io/tamada/gixor:0.4.0-blue?logo=docker)](https://github.com/tamada/gixor/pkgs/container/gixor/) +[![Docker](https://img.shields.io/badge/Docker-ghcr.io/tamada/gixor:0.4.1-blue?logo=docker)](https://github.com/tamada/gixor/pkgs/container/gixor/) [![Homebrew](https://img.shields.io/badge/Homebrew-tamada/tap/gixor-blue?logo=homebrew)](https://github.com/tamada/homebrew-tap) Gixor is Git Ignore Managenemnt System for Multiple Repositories. From e129ee79ece4c03cd1629989ff72bf263fb8a74a Mon Sep 17 00:00:00 2001 From: Haruaki Tamada Date: Wed, 5 Nov 2025 12:12:09 +0900 Subject: [PATCH 3/5] chore: update GITHUB_TOKEN environment variable for release creation and bump version to 0.4.1 --- .github/workflows/publish.yaml | 4 ++++ Cargo.lock | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 1fb5353..2d7d5f6 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -23,6 +23,8 @@ jobs: - name: Create release id: create_release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | gh release create v${{ steps.vars.outputs.tag }} \ --draft \ @@ -127,6 +129,8 @@ jobs: # publish release - name: Create release file shell: bash + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | DIR=${{ steps.vars.outputs.dir }} DIST=${{ matrix.target }} diff --git a/Cargo.lock b/Cargo.lock index 51a7b34..110a752 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -474,7 +474,7 @@ dependencies = [ [[package]] name = "gixor" -version = "0.4.0" +version = "0.4.1" dependencies = [ "dirs", "git2", @@ -488,7 +488,7 @@ dependencies = [ [[package]] name = "gixor-cli" -version = "0.4.0" +version = "0.4.1" dependencies = [ "atty", "clap", From c303a3aff55cf74931491eb70c77cbb92b19d7f8 Mon Sep 17 00:00:00 2001 From: Haruaki Tamada Date: Wed, 5 Nov 2025 14:40:00 +0900 Subject: [PATCH 4/5] refactor: update terminal detection method and remove unused dependencies --- Cargo.lock | 77 ++++--------------------------------------------- cli/Cargo.toml | 5 ++-- cli/src/main.rs | 2 +- 3 files changed, 9 insertions(+), 75 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 110a752..1a9b808 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -82,17 +82,6 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] - [[package]] name = "autocfg" version = "1.5.0" @@ -262,17 +251,6 @@ version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" -[[package]] -name = "dbus" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190b6255e8ab55a7b568df5a883e9497edc3e4821c06396612048b430e5ad1e9" -dependencies = [ - "libc", - "libdbus-sys", - "windows-sys 0.59.0", -] - [[package]] name = "dirs" version = "6.0.0" @@ -490,7 +468,6 @@ dependencies = [ name = "gixor-cli" version = "0.4.1" dependencies = [ - "atty", "clap", "clap_complete", "env_logger", @@ -546,15 +523,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - [[package]] name = "http" version = "1.3.1" @@ -895,16 +863,6 @@ version = "0.2.174" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" -[[package]] -name = "libdbus-sys" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cbe856efeb50e4681f010e9aaa2bf0a644e10139e54cde10fc83a307c23bd9f" -dependencies = [ - "cc", - "pkg-config", -] - [[package]] name = "libgit2-sys" version = "0.18.2+1.9.1" @@ -1064,14 +1022,13 @@ checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" [[package]] name = "opener" -version = "0.7.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0812e5e4df08da354c851a3376fead46db31c2214f849d3de356d774d057681" +checksum = "cb9024962ab91e00c89d2a14352a8d0fc1a64346bf96f1839b45c09149564e47" dependencies = [ "bstr", - "dbus", "normpath", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -1619,12 +1576,12 @@ dependencies = [ [[package]] name = "terminal_size" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45c6481c4829e4cc63825e62c49186a34538b7b2750b73b266581ffb612fb5ed" +checksum = "60b8cb979cb11c32ce1603f8137b22262a9d131aaa5c37b5678025f22b8becd0" dependencies = [ "rustix", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -1947,22 +1904,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - [[package]] name = "winapi-util" version = "0.1.9" @@ -1972,12 +1913,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows-link" version = "0.1.3" diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 8343aa5..3badb48 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -12,13 +12,12 @@ keywords.workspace = true [dependencies] gixor = { path = "../lib" } -atty = "0.2.14" clap = { version = "4.5.28", features = ["derive"] } clap_complete = "4.5.44" env_logger = "0.11.6" log = "0.4.25" -opener = "0.7.2" -terminal_size = "0.4.1" +opener = "0.8.3" +terminal_size = "0.4.3" [dev-dependencies] tokio = { version = "1.16.1", features = ["full"] } diff --git a/cli/src/main.rs b/cli/src/main.rs index 7cad980..7e0307d 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -167,7 +167,7 @@ fn list_boilerplates(gixor: &Gixor, opts: cli::ListOpts) -> Result, header: Option) { - if atty::is(atty::Stream::Stdout) { + if std::io::IsTerminal::is_terminal(&std::io::stdout()) { let term = terminal::Terminal::default(); if let Some(header) = header { println!("{}", term.format_header(header)); From 4479b05340c4eb974d5f4c4b638a72d417e6322e Mon Sep 17 00:00:00 2001 From: Haruaki Tamada Date: Wed, 5 Nov 2025 15:17:09 +0900 Subject: [PATCH 5/5] fix: add permissions for finalize_release job and update publish command to publish the release --- .github/workflows/publish.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 2d7d5f6..d85c258 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -201,10 +201,12 @@ jobs: finalize_release: needs: publish runs-on: ubuntu-latest + permissions: + contents: write steps: - name: Publish the release id: publish_release - run: | + run: gh release edit --draft=false --repo $GITHUB_REPOSITORY v${{ needs.publish.outputs.tag }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}