diff --git a/.github/workflows/binary.yml.disable b/.github/workflows/binary.yml.disable new file mode 100644 index 0000000..d63ca9e --- /dev/null +++ b/.github/workflows/binary.yml.disable @@ -0,0 +1,57 @@ +name: Build binary + +on: + workflow_dispatch: + pull_request: + paths: + - "**.zig" + - ".github/workflows/CI.yml" + - ".github/workflows/binary.yml" + push: + branches: + - main + paths: + - "**.zig" + - ".github/workflows/binary.yml" + +env: + ZIG_VERSION: 0.13.0 + +jobs: + build: + timeout-minutes: 10 + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + targets: + - "x86-windows" + - "x86_64-windows" + - "aarch64-windows" + - "x86-linux" + - "x86_64-linux" + - "arm-linux-musleabi" + - "aarch64-linux" + - "x86_64-macos" + - "aarch64-macos" + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - uses: mlugg/setup-zig@v1 + with: + version: ${{ env.ZIG_VERSION }} + - name: Set Environment Variables + run: | + echo "BUILD_DATE=$(date +'%Y-%m-%dT%H:%M:%S%z')" >> $GITHUB_ENV + - name: Build + run: | + zig build -Dtarget=${{ matrix.targets }} -Doptimize=ReleaseSafe \ + -Dgit_commit=${{ github.head_ref }}-${{ github.sha }} \ + -Dbuild_date=${{ env.BUILD_DATE }} + tar -cvf zigcli.tar zig-out/bin/ + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: zigcli-${{ matrix.targets }} + path: zigcli.tar diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d812612..c9e69dd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,13 +37,13 @@ jobs: - uses: mlugg/setup-zig@v1 with: version: 0.13.0 - - name: Set env + - name: Set env(release) if: startsWith(github.ref, 'refs/tags/') run: | echo "RELEASE_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV echo "OUT_DIR=/tmp/zigcli" >> $GITHUB_ENV - - name: Set env - if: !startsWith(github.ref, 'refs/tags/') + - name: Set env(dev) + if: "!startsWith(github.ref, 'refs/tags/')" run: | echo "RELEASE_VERSION=unknown" >> $GITHUB_ENV echo "OUT_DIR=/tmp/zigcli" >> $GITHUB_ENV @@ -69,7 +69,7 @@ jobs: with: files: ${{ env.OUT_DIR }}/* - name: Upload - if: !startsWith(github.ref, 'refs/tags/') + if: "!startsWith(github.ref, 'refs/tags/')" uses: actions/upload-artifact@v4 with: name: zigcli-${{ matrix.os }} diff --git a/docs/content/programs/zigfetch.org b/docs/content/programs/zigfetch.org index 5504610..17aaf84 100644 --- a/docs/content/programs/zigfetch.org +++ b/docs/content/programs/zigfetch.org @@ -1,9 +1,19 @@ #+TITLE: zigfetch #+DATE: 2025-01-01T18:01:47+0800 -#+LASTMOD: 2025-01-01T18:03:40+0800 +#+LASTMOD: 2025-01-01T19:08:03+0800 #+TYPE: docs #+DESCRIPTION: Fetch zig package, baked by libcurl. +=zigfetch= behaves similarly to =zig fetch=, utilizing the capabilities of libcurl for its functionality. + +Since the HTTP support within Zig's standard library isn't currently stable, this issue leads to various errors during dependency downloads when building Zig projects. + +{{< figure src="https://fs.liujiacai.net/cdn-img/zigcli/zig-fetch-errors.webp" caption="Zig fetch errors">}} + +This poses a significant challenge for Chinese developers owing to [[https://en.wikipedia.org/wiki/Great_Firewall][the Great Firewall]]. + +=zigfetch= is baked by libcurl, so [[https://curl.se/libcurl/c/libcurl-env.html][http_proxy/https_proxy]] env vars work as expected. + #+begin_src bash :results verbatim :exports result :dir ../../.. ./zig-out/bin/zigfetch --help #+end_src