diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index f4da66c..a580fff 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -3,8 +3,8 @@ name: CD on: push: tags: - # - "v[0-9]+.[0-9]+.[0-9]+" - - "*" + - "v[0-9]+.[0-9]+.[0-9]+" + # - "*" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index ad4c9a3..de9edc7 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -5,6 +5,8 @@ on: branches: [ main ] pull_request: branches: [ main ] + release: + types: [ created, published ] env: GH_TOKEN: ${{ github.token }} @@ -29,7 +31,7 @@ jobs: - name: Download TDLib if: matrix.feature == 'default' || matrix.feature == 'pkg-config' run: | - gh release download test --pattern 'Linux*.zip' + gh release download --pattern 'tdlib-*-linux-x86_64.zip' # test unzip -q *.zip -d . - name: Set pkg-config environment variables if: matrix.feature == 'pkg-config' diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml index f874718..f8bf5dd 100644 --- a/.github/workflows/ci-macos.yml +++ b/.github/workflows/ci-macos.yml @@ -5,6 +5,8 @@ on: branches: [ main ] pull_request: branches: [ main ] + release: + types: [ created, published ] env: GH_TOKEN: ${{ github.token }} @@ -30,7 +32,7 @@ jobs: - name: Download TDLib if: matrix.feature == 'default' || matrix.feature == 'pkg-config' run: | - gh release download test --pattern ${{ runner.arch == 'ARM64' && 'macOS-ARM64*.zip' || 'macOS-X64*.zip' }} + gh release download --pattern ${{ runner.arch == 'ARM64' && 'tdlib-*-macos-aarch64.zip' || 'tdlib-*-macos-x86_64.zip' }} # test unzip -q *.zip -d . - name: Set pkg-config environment variables if: matrix.feature == 'pkg-config' diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index 59343a4..7cc9ce1 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -5,6 +5,8 @@ on: branches: [ main ] pull_request: branches: [ main ] + release: + types: [ created, published ] env: GH_TOKEN: ${{ github.token }} @@ -29,7 +31,7 @@ jobs: - name: Download TDLib if: matrix.feature == 'default' || matrix.feature == 'pkg-config' run: | - gh release download test --pattern 'Windows*.zip' + gh release download --pattern 'tdlib-*-windows-x86_64.zip' # test unzip -q *.zip -d . shell: bash - name: Install pkg-config diff --git a/tdlib-rs/build.rs b/tdlib-rs/build.rs index 32a4b35..cdff044 100644 --- a/tdlib-rs/build.rs +++ b/tdlib-rs/build.rs @@ -121,35 +121,34 @@ fn generic_build() { #[cfg(feature = "download-tdlib")] fn download_tdlib() { let base_url = "https://github.com/FedericoBruzzone/tdlib-rs/releases/download"; - // let url = format!( - // "{}/v{}/tdlib-{}-{}-{}.zip", - // base_url, - // env!("CARGO_PKG_VERSION"), - // TDLIB_VERSION, - // std::env::var("CARGO_CFG_TARGET_OS").unwrap(), - // std::env::var("CARGO_CFG_TARGET_ARCH").unwrap(), - // ); - let target_os = if cfg!(target_os = "windows") { - "Windows" - } else if cfg!(target_os = "linux") { - "Linux" - } else if cfg!(target_os = "macos") { - "macOS" - } else { - "" - }; - let target_arch = if cfg!(target_arch = "x86_64") { - "X64" - } else if cfg!(target_arch = "aarch64") { - "ARM64" - } else { - "" - }; - let url = format!( - "{}/test/{}-{}-TDLib-{}.zip", - base_url, target_os, target_arch, "2589c3fd46925f5d57e4ec79233cd1bd0f5d0c09" + "{}/v{}/tdlib-{}-{}-{}.zip", + base_url, + env!("CARGO_PKG_VERSION"), + TDLIB_VERSION, + std::env::var("CARGO_CFG_TARGET_OS").unwrap(), + std::env::var("CARGO_CFG_TARGET_ARCH").unwrap(), ); + // let target_os = if cfg!(target_os = "windows") { + // "Windows" + // } else if cfg!(target_os = "linux") { + // "Linux" + // } else if cfg!(target_os = "macos") { + // "macOS" + // } else { + // "" + // }; + // let target_arch = if cfg!(target_arch = "x86_64") { + // "X64" + // } else if cfg!(target_arch = "aarch64") { + // "ARM64" + // } else { + // "" + // }; + // let url = format!( + // "{}/test/{}-{}-TDLib-{}.zip", + // base_url, target_os, target_arch, "2589c3fd46925f5d57e4ec79233cd1bd0f5d0c09" + // ); let out_dir = env::var("OUT_DIR").unwrap(); let tdlib_dir = format!("{}/tdlib", &out_dir);