diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..aad2428 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,83 @@ +name: Release + +on: + push: + tags: + - "v*" + workflow_dispatch: + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "10.0.x" + + - name: Resolve version + id: ver + run: | + set -euo pipefail + ref="${GITHUB_REF_NAME}" + if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then + version="${ref#v}" + elif [[ "${GITHUB_REF}" == refs/tags/* ]]; then + version="${ref}" + else + # workflow_dispatch on a branch: use short SHA so artifacts are still named + version="dev-${GITHUB_SHA::7}" + fi + echo "version=${version}" >> "$GITHUB_OUTPUT" + echo "Resolved version: ${version}" + + - name: Publish multi-RID packages + run: | + set -euo pipefail + VERSION="${{ steps.ver.outputs.version }}" + PROJECT="src/Exceltk/Exceltk.csproj" + mkdir -p dist + + for rid in linux-x64 osx-x64 osx-arm64 win-x86; do + out="publish/${rid}" + echo "::group::Publish ${rid}" + dotnet publish "$PROJECT" \ + -c Release \ + -r "$rid" \ + --self-contained true \ + -o "$out" \ + -p:PublishSingleFile=true \ + -p:IncludeNativeLibrariesForSelfExtract=true \ + -p:EnableCompressionInSingleFile=true + echo "::endgroup::" + + if [[ "$rid" == win-* ]]; then + asset="dist/exceltk-${VERSION}-${rid}.zip" + (cd "$out" && zip -qr "../../${asset}" .) + else + asset="dist/exceltk-${VERSION}-${rid}.tar.gz" + tar -czf "$asset" -C "$out" . + fi + ls -lh "$asset" + done + + - name: Upload workflow artifacts + uses: actions/upload-artifact@v4 + with: + name: exceltk-${{ steps.ver.outputs.version }} + path: dist/* + + - name: Create GitHub Release + if: startsWith(github.ref, 'refs/tags/v') + uses: softprops/action-gh-release@v2 + with: + files: dist/* + generate_release_notes: true + fail_on_unmatched_files: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 72c2f86..67e3455 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,13 @@ .DS_Store .vscode/ +# Release binaries belong on GitHub Releases, not in git +pub/*.zip +pub/*.pkg +pub/*.7z +publish/ +dist/ + src/.vs src/Exceltk/bin/ src/Exceltk/obj/ diff --git a/README.md b/README.md index 0079bc9..d80248d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Excel toolkit. [![Build Status](https://travis-ci.org/fanfeilong/exceltk.svg?branch=master)](https://travis-ci.org/fanfeilong/exceltk) +Excel toolkit. [![CI](https://github.com/fanfeilong/exceltk/actions/workflows/ci.yml/badge.svg)](https://github.com/fanfeilong/exceltk/actions/workflows/ci.yml) Table SHOULD be edited by advanced GUI applications, BUT converted to any other format. @@ -46,8 +46,8 @@ Table SHOULD be edited by advanced GUI applications, BUT converted to any other # Removed: clipboard monitor (`-t cm`) - `-t cm` (GUI clipboard watcher) existed only in **0.0.9** on Windows and was **removed** afterwards - - Download 0.0.9 if you still need it: http://files.cnblogs.com/files/math/exceltk0.0.9.7z - Current versions convert files with `-t md|json|tex` instead + - If you still need 0.0.9, look for an archived asset on [Releases](https://github.com/fanfeilong/exceltk/releases) (do not rely on README version matrices) # Convert Excel to Json chagne the `-t` option to `json` @@ -59,15 +59,25 @@ Table SHOULD be edited by advanced GUI applications, BUT converted to any other - using `-st n` option to split table into multitable - using `-sn` option to adjust number, for example, `1234656` will be split into `1 2 3 4 5 6`, it the table width is too large, this is useful -# Download: +# Download -## 0.1.3 - - mac: https://github.com/fanfeilong/exceltk/blob/master/pub/exceltk.0.1.3.pkg - - windows: http://files.cnblogs.com/files/math/exceltk.0.1.3.zip +Prebuilt binaries are published through **GitHub Releases** (CI builds self-contained packages for each RID on version tags `v*`). -## 0.0.9 for windows - - http://fanfeilong.github.io/exceltk0.0.9.7z - - http://files.cnblogs.com/files/math/exceltk0.0.9.7z +- **Latest release**: https://github.com/fanfeilong/exceltk/releases/latest +- **All releases**: https://github.com/fanfeilong/exceltk/releases + +Pick the asset that matches your OS: + +| Asset RID | Platform | +| --- | --- | +| `linux-x64` | Linux x64 (`.tar.gz`) | +| `osx-x64` | macOS Intel (`.tar.gz`) | +| `osx-arm64` | macOS Apple Silicon (`.tar.gz`) | +| `win-x86` | Windows (`.zip`) | + +Example asset name: `exceltk-0.1.4-linux-x64.tar.gz`. + +To cut a release: tag `vX.Y.Z` and push; `.github/workflows/release.yml` publishes the assets. # 3rd projects diff --git a/README.txt b/README.txt index 2e85e3c..6101ad7 100644 --- a/README.txt +++ b/README.txt @@ -26,7 +26,12 @@ # Removed: clipboard monitor (`-t cm`) - `-t cm` only existed in 0.0.9 (Windows GUI) and was removed later - - Old build: http://files.cnblogs.com/files/math/exceltk0.0.9.7z + - Prefer [GitHub Releases](https://github.com/fanfeilong/exceltk/releases) for any archived 0.0.9 asset + +# Download + - Latest: https://github.com/fanfeilong/exceltk/releases/latest + - All versions: https://github.com/fanfeilong/exceltk/releases + - Assets: `linux-x64` / `osx-x64` / `osx-arm64` (`.tar.gz`), `win-x86` (`.zip`) # Convert Excel to Json chagne the `-t` option to `json` diff --git a/README.zhcn.txt b/README.zhcn.txt index b003cba..b4c0e1e 100644 --- a/README.zhcn.txt +++ b/README.zhcn.txt @@ -40,8 +40,17 @@ Mac OS 版本请在命令行下直接使用`exceltk`,不用带exe后缀,MacO ## 已移除:剪切板监控(`-t cm`) - `-t cm`(Windows GUI,监控剪切板并即时转 Markdown)**仅在 0.0.9 提供**,之后版本已移除 -- 如需该功能请下载 0.0.9:http://files.cnblogs.com/files/math/exceltk0.0.9.7z - 当前版本请用 `-t md|json|tex` 转换文件 +- 如仍需 0.0.9,请到 [Releases](https://github.com/fanfeilong/exceltk/releases) 查找归档资源(不要再依赖 README 里的多版本下载列表) + +## 下载 + +预编译包通过 **GitHub Releases** 发布(打 `v*` 标签后由 Actions 为各 RID 构建自包含包): + +- 最新版:https://github.com/fanfeilong/exceltk/releases/latest +- 全部版本:https://github.com/fanfeilong/exceltk/releases + +按系统选择资源:`linux-x64` / `osx-x64` / `osx-arm64`(`.tar.gz`),`win-x86`(`.zip`)。 ## 解决在移动设备上表格不能自适应的问题 diff --git a/pub/README.md b/pub/README.md new file mode 100644 index 0000000..d8d697f --- /dev/null +++ b/pub/README.md @@ -0,0 +1,7 @@ +# Legacy local publish folder +# +# Do **not** add new binaries here. Multi-platform builds are published by +# GitHub Actions (`.github/workflows/release.yml`) to GitHub Releases: +# https://github.com/fanfeilong/exceltk/releases +# +# Existing archived files in this directory (if any) are historical only. diff --git a/pub/exceltk.0.1.0.pkg b/pub/exceltk.0.1.0.pkg deleted file mode 100644 index 0464248..0000000 Binary files a/pub/exceltk.0.1.0.pkg and /dev/null differ diff --git a/pub/exceltk.0.1.0.zip b/pub/exceltk.0.1.0.zip deleted file mode 100644 index e089ef8..0000000 Binary files a/pub/exceltk.0.1.0.zip and /dev/null differ diff --git a/pub/exceltk.0.1.1.pkg b/pub/exceltk.0.1.1.pkg deleted file mode 100644 index 8a98450..0000000 Binary files a/pub/exceltk.0.1.1.pkg and /dev/null differ diff --git a/pub/exceltk.0.1.1.zip b/pub/exceltk.0.1.1.zip deleted file mode 100644 index 0153205..0000000 Binary files a/pub/exceltk.0.1.1.zip and /dev/null differ diff --git a/pub/exceltk.0.1.2.pkg b/pub/exceltk.0.1.2.pkg deleted file mode 100644 index d9a5c60..0000000 Binary files a/pub/exceltk.0.1.2.pkg and /dev/null differ diff --git a/pub/exceltk.0.1.2.zip b/pub/exceltk.0.1.2.zip deleted file mode 100644 index 2eb6843..0000000 Binary files a/pub/exceltk.0.1.2.zip and /dev/null differ diff --git a/pub/exceltk.0.1.3.pkg b/pub/exceltk.0.1.3.pkg deleted file mode 100644 index a32dcb0..0000000 Binary files a/pub/exceltk.0.1.3.pkg and /dev/null differ diff --git a/pub/exceltk.0.1.3.zip b/pub/exceltk.0.1.3.zip deleted file mode 100644 index f19dc2c..0000000 Binary files a/pub/exceltk.0.1.3.zip and /dev/null differ diff --git a/update.md b/update.md index 269793c..e63f6eb 100644 --- a/update.md +++ b/update.md @@ -1,15 +1,9 @@ -[exceltk 0.1.0] +[exceltk] - 功能:excel表格转markdown命令行小工具 -- 新增:指定对齐 - exceltk -t md -a r -xls example.xlsx -- 新增:单元格内换行会自动转成
-- 新增:MacOSX独立安装包版 -- 移除:去掉剪切版GUI支持,需要该功能请使用0.0.9版 - -# 下载 -- mac(试用): https://github.com/fanfeilong/exceltk/blob/master/pub/exceltk.0.1.0.pkg -- windows: http://files.cnblogs.com/files/math/exceltk.0.1.0.zip +- 发布:请使用 GitHub Releases(打 `v*` 标签后由 Actions 发布多 RID 包) + - https://github.com/fanfeilong/exceltk/releases/latest + - https://github.com/fanfeilong/exceltk/releases # 文档: - zh-cn:http://www.cnblogs.com/math/p/exceltk.html -- en:https://github.com/fanfeilong/exceltk \ No newline at end of file +- en:https://github.com/fanfeilong/exceltk