21 Commits
Author SHA1 Message Date
github-actions[bot] 03ad3bd6d1 chore: update cc-switch to 4.0.26 2026-11-06 09:28:34 +00:00
github-actions[bot] fbf70cd1e1 chore: update cc-switch to 4.0.25 2026-11-03 09:39:40 +00:00
github-actions[bot] 95c916a1b3 chore: update cc-switch to 4.0.24 2026-11-02 09:36:17 +00:00
github-actions[bot] 412d93f188 chore: update cc-switch to 4.0.23 2026-11-01 09:21:15 +00:00
github-actions[bot] dfaafb6e75 chore: update cc-switch to 4.0.22 2026-10-30 08:43:26 +00:00
github-actions[bot] 163dd2310d chore: update cc-switch to 4.0.21 2026-10-27 07:57:40 +00:00
github-actions[bot] dcc0a776c4 chore: update cc-switch to 4.0.20 2026-10-25 07:38:38 +00:00
github-actions[bot] cce9858060 chore: update cc-switch to 4.0.19 2026-10-24 07:22:08 +00:00
github-actions[bot] 4f1c14bdd5 chore: update cc-switch to 4.0.18 2026-10-22 07:40:18 +00:00
github-actions[bot] ebf8d7373b chore: update cc-switch to 4.0.17 2026-10-21 07:44:52 +00:00
Melorise 0bc69ee0ca Update README with known issues
Added known issues with cc switch.
2026-10-21 10:20:57 +08:00
github-actions[bot] 4ec4ae0f53 chore: update cc-switch to 4.0.16 2026-10-20 07:40:38 +00:00
github-actions[bot] 3b929ad11c chore: update cc-switch to 4.0.15 2026-10-18 07:16:54 +00:00
github-actions[bot] 26c8310b3e chore: update cc-switch to 4.0.14 2026-10-17 07:01:04 +00:00
github-actions[bot] d01eea6f99 chore: update cc-switch to 4.0.13 2026-10-16 07:16:29 +00:00
github-actions[bot] 610309a201 chore: update cc-switch to 4.0.12 2026-10-15 07:31:27 +00:00
github-actions[bot] 3a07237fda chore: update cc-switch to 4.0.11 2026-10-14 07:43:51 +00:00
github-actions[bot] 003caecf0e chore: update cc-switch to 4.0.10 2026-10-13 04:00:09 +00:00
Melorise 398514a1bf add auto update 2026-10-12 17:40:15 +08:00
Melorise b44fc1698b update to 4.0.9 2026-10-12 16:45:04 +08:00
Melorise 238bf640d7 add depandency 2026-09-14 10:21:24 +08:00
3 changed files with 89 additions and 5 deletions
+76
View File
@@ -0,0 +1,76 @@
name: Update upstream version
on:
schedule:
- cron: "17 2 * * *"
workflow_dispatch:
permissions:
contents: write
concurrency:
group: update-upstream
cancel-in-progress: true
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Update version in flake.nix
id: update
env:
GH_TOKEN: ${{ github.token }}
shell: bash
run: |
set -euo pipefail
latest_tag="$(curl --fail --silent --show-error --location \
-H 'Accept: application/vnd.github+json' \
-H "Authorization: Bearer $GH_TOKEN" \
https://api.github.com/repos/farion1231/cc-switch/releases/latest \
| jq --exit-status --raw-output '.tag_name')"
latest_version="${latest_tag#v}"
if [[ ! "$latest_tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Unsupported upstream release tag: $latest_tag" >&2
exit 1
fi
current_version="$(sed -nE \
's/^[[:space:]]*version = "([^"]+)";/\1/p' \
flake.nix | head -n 1)"
if [[ -z "$current_version" ]]; then
echo "Could not find the package version in flake.nix" >&2
exit 1
fi
newest_version="$(printf '%s\n' "$current_version" "$latest_version" | sort -V | tail -n 1)"
if [[ "$current_version" == "$latest_version" || "$newest_version" != "$latest_version" ]]; then
echo "No newer release available; current version is $current_version"
echo "updated=false" >> "$GITHUB_OUTPUT"
exit 0
fi
current_pattern="${current_version//./\\.}"
sed -i -E "s/${current_pattern}/${latest_version}/g" flake.nix
echo "Updated CC Switch from $current_version to $latest_version"
echo "updated=true" >> "$GITHUB_OUTPUT"
echo "version=$latest_version" >> "$GITHUB_OUTPUT"
- name: Commit and push version update
if: steps.update.outputs.updated == 'true'
env:
VERSION: ${{ steps.update.outputs.version }}
shell: bash
run: |
set -euo pipefail
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add flake.nix
git commit -m "chore: update cc-switch to $VERSION"
git push
+8 -2
View File
@@ -1,2 +1,8 @@
cc-switch nix flake版
官方nixpkgs更新太慢,appimage版又有输入错误,该版是从deb重打包的
# cc-switch nix flake版
官方nixpkgs更新太慢,appimage版又有输入错误,该版是从deb重打包的
GitHub Actions 每天北京时间 10:17(UTC 02:17)检查上游最新正式 Release。当上游版本高于当前版本时,工作流会替换 `flake.nix` 中的版本号(包括描述、下载链接和包版本),自动提交并推送。也可以通过 Actions 页面手动运行 `Update upstream version` 工作流。
# 已知问题
因为nixos特殊的应用级隔离,在cc switch中修改claude code、codex等的配置目录不起作用
建议:自行创建自定义目录到默认目录的链接,不要使用 cc switch修改
+5 -3
View File
@@ -1,11 +1,11 @@
{
description = "CC Switch 3.20.3 repackaged from the upstream x86_64 Debian release";
description = "CC Switch 4.0.26 repackaged from the upstream x86_64 Debian release";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
cc-switch-x86_64 = {
url = "file+https://github.com/farion1231/cc-switch/releases/download/v3.20.3/CC-Switch-v3.20.3-Linux-x86_64.deb";
url = "file+https://github.com/farion1231/cc-switch/releases/download/v4.0.26/CC-Switch-v4.0.26-Linux-x86_64.deb";
flake = false;
};
};
@@ -23,7 +23,7 @@
packages.x86_64-linux = {
cc-switch = pkgs.stdenv.mkDerivation {
pname = "cc-switch";
version = "3.20.3";
version = "4.0.26";
src = cc-switch-x86_64;
nativeBuildInputs = with pkgs; [
@@ -42,6 +42,8 @@
xz
];
runtimeDependencies = with pkgs; [ libayatana-appindicator ];
unpackPhase = ''
bsdtar --extract --to-stdout --file "$src" data.tar.gz \
| bsdtar --extract --file - --no-same-owner