Skip to content

Commit

Permalink
Prepare test release
Browse files Browse the repository at this point in the history
Signed-off-by: FedericoBruzzone <federico.bruzzone.i@gmail.com>
  • Loading branch information
FedericoBruzzone committed May 26, 2024
1 parent c9849cd commit 17ab672
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 32 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [ created, published ]

env:
GH_TOKEN: ${{ github.token }}
Expand All @@ -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'
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [ created, published ]

env:
GH_TOKEN: ${{ github.token }}
Expand All @@ -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'
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [ created, published ]

env:
GH_TOKEN: ${{ github.token }}
Expand All @@ -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
Expand Down
53 changes: 26 additions & 27 deletions tdlib-rs/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 17ab672

Please sign in to comment.