Skip to content

Commit d5e3e64

Browse files
committed
org to md
1 parent e9fc9d3 commit d5e3e64

File tree

4 files changed

+23
-10
lines changed

4 files changed

+23
-10
lines changed

.github/build-release.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
#!/usr/bin/env bash
22

3-
out_dir="/tmp/zigcli-release/"
4-
version=${RELEASE_VERSION:-unknown}
3+
OUT_DIR=${OUT_DIR:-/tmp/zigcli}
4+
VERSION=${RELEASE_VERSION:-unknown}
55

66
set -Eeuo pipefail
77
trap cleanup SIGINT SIGTERM ERR EXIT
88
cleanup() {
99
trap - SIGINT SIGTERM ERR EXIT
10-
ls -ltrh "${out_dir}"
11-
rm -rf "${out_dir}/*"
10+
ls -ltrh "${OUT_DIR}"
11+
rm -rf "${OUT_DIR}/*"
1212
}
1313

14-
mkdir -p "${out_dir}"
14+
mkdir -p "${OUT_DIR}"
1515
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
1616

1717
cd "${script_dir}/.."
@@ -28,11 +28,15 @@ targets=(
2828
export BUILD_DATE=$(date +'%Y-%m-%dT%H:%M:%S%z')
2929
export GIT_COMMIT=$(git rev-parse --short HEAD)
3030

31+
pandoc -f org -t markdown README.org -o README.md
32+
3133
for target in "${targets[@]}"; do
3234
echo "Building for ${target}..."
35+
rm -rf zig-out/
3336
zig build -Doptimize=ReleaseSafe -Dtarget="${target}" \
3437
-Dgit_commit=${GIT_COMMIT} -Dbuild_date=${BUILD_DATE} -Dis_ci=true
38+
rm -f zig-out/bin/*demo
3539
pushd zig-out
36-
zip -r zigcli-${version}-${target}.zip bin ../LICENSE ../README.org
40+
zip -r ${OUT_DIR}/zigcli-${VERSION}-${target}.zip bin ../LICENSE ../README.md
3741
popd
3842
done

.github/workflows/release.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
permissions:
1010
contents: write
1111

12+
env:
13+
OUT_DIR: /tmp/zigcli-release
14+
1215
jobs:
1316
upload-assets:
1417
runs-on: ubuntu-latest
@@ -21,11 +24,15 @@ jobs:
2124
- name: Set env
2225
run: |
2326
echo "RELEASE_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
27+
- name: Install
28+
uses: pandoc/actions/setup@v1
29+
with:
30+
version: 2.19
2431
- name: Build
2532
run: |
2633
bash .github/build-release.sh
2734
- name: Release
2835
uses: softprops/action-gh-release@v2
2936
if: startsWith(github.ref, 'refs/tags/')
3037
with:
31-
files: /tmp/zigcli-release/*
38+
files: ${{ env.OUT_DIR }}/*

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
/.zig-cache
44
*lock
55
docs/resources
6-
docs/public
6+
docs/public
7+
README.md

docs/content/programs/_index.org

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#+TITLE: Programs
22
#+DATE: 2023-10-21T12:26:45+0800
3-
#+LASTMOD: 2024-09-01T09:57:50+0800
3+
#+LASTMOD: 2024-09-28T11:50:42+0800
44
#+TYPE: docs
55
#+WEIGHT: 20
66
#+DESCRIPTION: Binary programs which can be used directly
77

88
* Install
9-
Prebuilt binaries can be found in [[https://github.com/jiacai2050/zigcli/actions/workflows/binary.yml][CI's artifacts]], or you can build from source:
9+
Latest pre-built binaries can be downloaded on the [[https://github.com/jiacai2050/zigcli/releases][release page]], or you can build from source:
10+
1011
#+begin_src bash
1112
git clone https://github.com/jiacai2050/zigcli.git
1213
#+end_src

0 commit comments

Comments
 (0)