Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jiacai2050 committed Jan 1, 2025
1 parent f4676ba commit a54e790
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 5 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/binary.yml.disable
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand Down
12 changes: 11 additions & 1 deletion docs/content/programs/zigfetch.org
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit a54e790

Please sign in to comment.