├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ └── 错误报告.md └── workflows │ ├── release.yml │ ├── release_beta.yml │ └── tag.yml ├── .gitignore ├── README.md ├── package.json ├── pnpm-lock.yaml └── proxy.ts /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/错误报告.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 错误报告 3 | about: 创建一个报告来帮助我们改进,仅作为错误报告,使用相关的问题请直接通过面包多私信 4 | title: "[BUG] 问题名称" 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | ### 使用的存储驱动 11 | 12 | 13 | 14 | ### 问题描述 15 | 16 | 17 | 18 | ### 复现步骤 19 | 20 | 1. 添加…… 21 | 2. …… 22 | 3. …… 23 | 24 | ### 相关日志 25 | 26 | #### AList日志 27 | 28 | ```log 29 | …… 30 | ``` 31 | 32 | #### 挂载日志 33 | 34 | ```log 35 | …… 36 | ``` 37 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | on: 3 | push: 4 | tags: 5 | - "v*" 6 | workflow_dispatch: 7 | 8 | jobs: 9 | release: 10 | strategy: 11 | fail-fast: false 12 | matrix: 13 | include: 14 | - os: macos-latest 15 | target: x86_64-apple-darwin 16 | args: 17 | - os: ubuntu-22.04 18 | target: x86_64-unknown-linux-gnu 19 | args: 20 | - os: windows-latest 21 | target: x86_64-pc-windows-msvc 22 | args: 23 | - os: macos-latest 24 | target: aarch64-apple-darwin 25 | args: 26 | - os: windows-latest 27 | target: aarch64-pc-windows-msvc 28 | args: --bundles nsis,updater 29 | # - os: ubuntu-20.04 30 | # target: aarch64-unknown-linux-gnu 31 | 32 | runs-on: ${{ matrix.os }} 33 | steps: 34 | - name: Checkout repository 35 | uses: actions/checkout@v3 36 | with: 37 | repository: alist-dev/desktop 38 | token: ${{ secrets.MY_TOKEN }} 39 | 40 | - name: Install dependencies (ubuntu only) 41 | if: matrix.os == 'ubuntu-22.04' 42 | # You can remove libayatana-appindicator3-dev if you don't use the system tray feature. 43 | run: | 44 | sudo apt-get update 45 | sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev 46 | # sudo apt-get install -y libssl-dev pkg-config gcc-10-aarch64-linux-gnu 47 | 48 | - name: Rust setup 49 | uses: dtolnay/rust-toolchain@stable 50 | with: 51 | targets: ${{ matrix.target }} 52 | 53 | - name: Rust cache 54 | uses: swatinem/rust-cache@v2 55 | with: 56 | workspaces: "./src-tauri -> target" 57 | 58 | - uses: pnpm/action-setup@v2 59 | with: 60 | version: 9 61 | run_install: false 62 | 63 | - name: Sync node version and setup cache 64 | uses: actions/setup-node@v3 65 | with: 66 | node-version: "lts/*" 67 | cache: "pnpm" # Set this to npm, yarn or pnpm. 68 | 69 | - name: Install app dependencies and build web 70 | run: pnpm i 71 | 72 | - name: Replace version 73 | run: | 74 | npx tsx ./scripts/version.ts 75 | cat src-tauri/tauri.conf.json 76 | env: 77 | AD_VERSION: ${{ github.ref_name }} 78 | 79 | - name: Get AList version 80 | id: get-alist-version 81 | uses: fangqiuming/latest-release-version@v1.2.0-beta 82 | with: 83 | repository: AlistGo/alist 84 | token: ${{ secrets.GITHUB_TOKEN }} 85 | 86 | - name: Get Rclone version 87 | id: get-rclone-version 88 | uses: fangqiuming/latest-release-version@v1.2.0-beta 89 | with: 90 | repository: rclone/rclone 91 | token: ${{ secrets.GITHUB_TOKEN }} 92 | 93 | - name: Download sidecar 94 | run: npx tsx ./scripts/bin.ts 95 | env: 96 | TARGET_TRIPLE: ${{ matrix.target }} 97 | ALIST_VERSION: ${{ steps.get-alist-version.outputs.tag_name }} # v3.19.0 98 | RCLONE_VERSION: ${{ steps.get-rclone-version.outputs.tag_name }} # v1.63.0 99 | 100 | - name: Build the app 101 | uses: tauri-apps/tauri-action@v0 102 | env: 103 | GITHUB_TOKEN: ${{ secrets.MY_TOKEN }} 104 | TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} 105 | # PKG_CONFIG_ALLOW_CROSS: ${{ contains(matrix.target, 'aarch64') && '1' || '' }} 106 | with: 107 | tagName: ${{ github.ref_name }} # This only works if your workflow triggers on new tags. 108 | releaseName: "AList Desktop v__VERSION__" # tauri-action replaces \_\_VERSION\_\_ with the app version. 109 | releaseBody: "See the assets to download and install this version." 110 | args: "--target ${{ matrix.target }} ${{ matrix.args }}" 111 | 112 | build_updater: 113 | name: "Build updater" 114 | needs: release 115 | environment: ${{ github.event.inputs.environment || 'Beta' }} 116 | runs-on: ubuntu-latest 117 | steps: 118 | - name: Checkout repository 119 | uses: actions/checkout@v3 120 | 121 | - uses: pnpm/action-setup@v2 122 | with: 123 | version: 9 124 | run_install: false 125 | 126 | - name: Sync node version and setup cache 127 | uses: actions/setup-node@v3 128 | with: 129 | node-version: "lts/*" 130 | # cache: "pnpm" # Set this to npm, yarn or pnpm. 131 | 132 | - name: Generate proxy.json 133 | run: | 134 | npx tsx ./proxy.ts 135 | 136 | - name: Upload proxy.json 137 | uses: softprops/action-gh-release@v1 138 | with: 139 | fail_on_unmatched_files: true 140 | token: ${{ secrets.MY_TOKEN }} 141 | files: | 142 | *.proxy.json 143 | -------------------------------------------------------------------------------- /.github/workflows/release_beta.yml: -------------------------------------------------------------------------------- 1 | name: Release Beta 2 | on: 3 | push: 4 | branches: 5 | - main 6 | issue_comment: 7 | types: [created] 8 | workflow_dispatch: 9 | 10 | concurrency: 11 | group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} 12 | cancel-in-progress: true 13 | 14 | jobs: 15 | delete_old_beta: 16 | runs-on: ubuntu-latest 17 | if: ${{ github.event_name != 'issue_comment' || (github.event.issue.number == 69 && contains(github.event.comment.body, '/release-beta')) }} 18 | steps: 19 | 20 | - name: Create or update ref 21 | id: create-or-update-ref 22 | uses: ovsds/create-or-update-ref-action@v1 23 | with: 24 | ref: tags/beta 25 | sha: ${{ github.sha }} 26 | 27 | - name: Execute Delete Release/Tag action 28 | uses: ShivamHS/delete-tag@v1 29 | with: 30 | token: ${{ secrets.MY_TOKEN }} #generate new PAT and give delete access to it 31 | repo: desktop-release 32 | owner: alist-org 33 | keyword: beta 34 | deletetype: "release" #tag: will delete tags only; release: will delete releases only; tr: will delete both releases and tags 35 | 36 | release_beta: 37 | needs: delete_old_beta 38 | strategy: 39 | fail-fast: false 40 | matrix: 41 | include: 42 | - os: macos-latest 43 | target: x86_64-apple-darwin 44 | args: 45 | - os: ubuntu-22.04 46 | target: x86_64-unknown-linux-gnu 47 | args: 48 | - os: windows-latest 49 | target: x86_64-pc-windows-msvc 50 | args: --bundles nsis,updater 51 | - os: macos-latest 52 | target: aarch64-apple-darwin 53 | args: 54 | - os: windows-latest 55 | target: aarch64-pc-windows-msvc 56 | args: --bundles nsis,updater 57 | # - os: ubuntu-20.04 58 | # target: aarch64-unknown-linux-gnu 59 | 60 | runs-on: ${{ matrix.os }} 61 | steps: 62 | - name: Checkout repository 63 | uses: actions/checkout@v3 64 | with: 65 | repository: alist-dev/desktop 66 | token: ${{ secrets.MY_TOKEN }} 67 | 68 | - name: Install dependencies (ubuntu only) 69 | if: matrix.os == 'ubuntu-22.04' 70 | # You can remove libayatana-appindicator3-dev if you don't use the system tray feature. 71 | run: | 72 | sudo apt-get update 73 | sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev 74 | # sudo apt-get install -y libssl-dev pkg-config gcc-10-aarch64-linux-gnu 75 | 76 | - name: Rust setup 77 | uses: dtolnay/rust-toolchain@stable 78 | with: 79 | targets: ${{ matrix.target }} 80 | 81 | - name: Rust cache 82 | uses: swatinem/rust-cache@v2 83 | with: 84 | workspaces: "./src-tauri -> target" 85 | 86 | - uses: pnpm/action-setup@v2 87 | with: 88 | version: 9 89 | run_install: false 90 | 91 | - name: Sync node version and setup cache 92 | uses: actions/setup-node@v3 93 | with: 94 | node-version: "lts/*" 95 | cache: "pnpm" # Set this to npm, yarn or pnpm. 96 | 97 | - name: Install app dependencies and build web 98 | run: pnpm i 99 | 100 | - name: Replace version 101 | run: | 102 | npx tsx ./scripts/beta_version.ts 103 | cat src-tauri/tauri.conf.json 104 | env: 105 | AD_VERSION: ${{ github.ref_name }} 106 | TARGET_TRIPLE: ${{ matrix.target }} 107 | 108 | - name: Get Rclone version 109 | id: get-rclone-version 110 | uses: fangqiuming/latest-release-version@v1.2.0-beta 111 | with: 112 | repository: rclone/rclone 113 | token: ${{ secrets.GITHUB_TOKEN }} 114 | 115 | - name: Download sidecar 116 | run: npx tsx ./scripts/bin.ts 117 | env: 118 | TARGET_TRIPLE: ${{ matrix.target }} 119 | ALIST_VERSION: beta 120 | RCLONE_VERSION: ${{ steps.get-rclone-version.outputs.tag_name }} # v1.63.0 121 | 122 | - name: Build the app 123 | uses: tauri-apps/tauri-action@v0 124 | env: 125 | GITHUB_TOKEN: ${{ secrets.MY_TOKEN }} 126 | TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} 127 | # PKG_CONFIG_ALLOW_CROSS: ${{ contains(matrix.target, 'aarch64') && '1' || '' }} 128 | with: 129 | # tagName: ${{ github.ref_name }} # This only works if your workflow triggers on new tags. 130 | releaseName: "AList Desktop v__VERSION__" # tauri-action replaces \_\_VERSION\_\_ with the app version. 131 | releaseBody: "See the assets to download and install this version." 132 | args: "--target ${{ matrix.target }} ${{ matrix.args }}" 133 | prerelease: true 134 | tagName: beta 135 | 136 | build_updater: 137 | name: "Build updater beta" 138 | needs: release_beta 139 | environment: ${{ github.event.inputs.environment || 'Beta' }} 140 | runs-on: ubuntu-latest 141 | steps: 142 | - name: Checkout repository 143 | uses: actions/checkout@v3 144 | with: 145 | ref: main 146 | 147 | - uses: pnpm/action-setup@v2 148 | with: 149 | version: 9 150 | run_install: false 151 | 152 | - name: Sync node version and setup cache 153 | uses: actions/setup-node@v3 154 | with: 155 | node-version: "lts/*" 156 | # cache: "pnpm" # Set this to npm, yarn or pnpm. 157 | 158 | - name: Generate proxy.json 159 | run: | 160 | npx tsx ./proxy.ts 161 | 162 | - name: Upload proxy.json 163 | uses: softprops/action-gh-release@v1 164 | with: 165 | fail_on_unmatched_files: true 166 | token: ${{ secrets.MY_TOKEN }} 167 | tag_name: beta 168 | files: | 169 | *.proxy.json 170 | -------------------------------------------------------------------------------- /.github/workflows/tag.yml: -------------------------------------------------------------------------------- 1 | name: Tag 2 | on: 3 | push: 4 | tags: 5 | - "v*" 6 | workflow_dispatch: 7 | 8 | jobs: 9 | tag: 10 | name: Add tag to source repo 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout repo 14 | uses: actions/checkout@v3 15 | with: 16 | repository: alist-dev/desktop 17 | token: ${{ secrets.MY_TOKEN }} 18 | 19 | - name: Add tag 20 | run: | 21 | git config --local user.email "i@nn.ci" 22 | git config --local user.name "Andy Hsu" 23 | git tag -a ${{ github.ref_name }} -m "${{ github.ref_name }}" 24 | 25 | - name: Push tags 26 | uses: ad-m/github-push-action@master 27 | with: 28 | github_token: ${{ secrets.MY_TOKEN }} 29 | repository: alist-dev/desktop -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | alist-desktop.json 3 | alist-desktop-proxy.json -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # desktop-release 2 | 3 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "desktop-release", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "devDependencies": { 13 | "@types/node": "^20.3.3" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /pnpm-lock.yaml: -------------------------------------------------------------------------------- 1 | lockfileVersion: '9.0' 2 | 3 | settings: 4 | autoInstallPeers: true 5 | excludeLinksFromLockfile: false 6 | 7 | importers: 8 | 9 | .: 10 | devDependencies: 11 | '@types/node': 12 | specifier: ^20.3.3 13 | version: 20.3.3 14 | 15 | packages: 16 | 17 | '@types/node@20.3.3': 18 | resolution: {integrity: sha512-wheIYdr4NYML61AjC8MKj/2jrR/kDQri/CIpVoZwldwhnIrD/j9jIU5bJ8yBKuB2VhpFV7Ab6G2XkBjv9r9Zzw==} 19 | 20 | snapshots: 21 | 22 | '@types/node@20.3.3': {} 23 | -------------------------------------------------------------------------------- /proxy.ts: -------------------------------------------------------------------------------- 1 | import fs from "fs"; 2 | 3 | interface Updater { 4 | name: string; 5 | notes: string; 6 | pub_date: string; 7 | platforms: { 8 | [platform: string]: { 9 | url: string; 10 | signature: string; 11 | }; 12 | }; 13 | } 14 | 15 | // console.log(process.env); 16 | 17 | const repo = process.env.GITHUB_REPOSITORY!; 18 | 19 | async function getUpdater() { 20 | const res = await fetch( 21 | `https://github.com/${repo}/releases/latest/download/latest.json` 22 | ); 23 | const content = await res.json(); 24 | const updater: Updater = content; 25 | return updater; 26 | } 27 | 28 | function generateProxy(updater: Updater, proxy: string) { 29 | const { platforms } = updater; 30 | for (const plat in platforms) { 31 | const raw_url = platforms[plat].url; 32 | platforms[plat].url = `https://${proxy}/` + raw_url; 33 | } 34 | fs.writeFileSync(`${proxy}.proxy.json`, JSON.stringify(updater, null, 2)); 35 | } 36 | 37 | async function generateProxies() { 38 | const updater = await getUpdater(); 39 | generateProxy(updater, "ghfast.top"); 40 | } 41 | 42 | generateProxies(); 43 | --------------------------------------------------------------------------------