2021-02-01 19:06:12 +03:00
|
|
|
name: release
|
2021-01-30 00:30:13 +03:00
|
|
|
|
2021-02-20 16:17:42 +03:00
|
|
|
on: [push, pull_request]
|
2021-01-30 00:30:13 +03:00
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
2021-11-25 12:25:00 +03:00
|
|
|
release-generic-linux-x64:
|
2021-01-30 00:30:13 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2022-05-17 11:04:49 +03:00
|
|
|
uses: actions/checkout@v3
|
2021-01-30 00:30:13 +03:00
|
|
|
- name: Install Rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
profile: minimal
|
2021-02-01 23:49:34 +03:00
|
|
|
- name: Environment
|
2021-02-01 23:57:36 +03:00
|
|
|
run: |
|
2021-02-01 23:49:34 +03:00
|
|
|
uname -a
|
2021-02-02 00:00:17 +03:00
|
|
|
cargo --version
|
2021-01-30 00:30:13 +03:00
|
|
|
- name: set Version
|
|
|
|
run: |
|
|
|
|
echo VERSION=$(grep '^version' packages/hurl/Cargo.toml | cut -f2 -d'"') >> $GITHUB_ENV
|
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
ci/man.sh
|
2021-02-20 16:17:42 +03:00
|
|
|
# Install libcurl dev so that hurl can be built dynamically with libcurl
|
2021-07-24 10:49:58 +03:00
|
|
|
sudo apt update
|
2021-02-20 16:17:42 +03:00
|
|
|
sudo apt install libcurl4-openssl-dev
|
2021-01-30 00:30:13 +03:00
|
|
|
ci/release.sh
|
|
|
|
ci/create_tarball.sh linux
|
2021-11-25 12:25:00 +03:00
|
|
|
- name: Archive production artifacts
|
2022-05-17 11:04:53 +03:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-11-25 12:25:00 +03:00
|
|
|
with:
|
|
|
|
name: release-generic-linux-x64-artifacts
|
|
|
|
path: target/upload/*
|
|
|
|
|
|
|
|
release-deb-x64:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2022-05-17 11:04:49 +03:00
|
|
|
uses: actions/checkout@v3
|
2021-11-25 12:25:00 +03:00
|
|
|
- name: Install Rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
profile: minimal
|
|
|
|
- name: Environment
|
|
|
|
run: |
|
|
|
|
uname -a
|
|
|
|
cargo --version
|
|
|
|
- name: set Version
|
|
|
|
run: |
|
|
|
|
echo VERSION=$(grep '^version' packages/hurl/Cargo.toml | cut -f2 -d'"') >> $GITHUB_ENV
|
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
ci/man.sh
|
|
|
|
# Install libcurl dev so that hurl can be built dynamically with libcurl
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install libcurl4-openssl-dev
|
|
|
|
ci/release.sh
|
2021-01-30 00:30:13 +03:00
|
|
|
ci/deb.sh
|
|
|
|
- name: Archive production artifacts
|
2022-05-17 11:04:53 +03:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-01-30 00:30:13 +03:00
|
|
|
with:
|
2021-11-25 12:25:00 +03:00
|
|
|
name: release-deb-x64-artifacts
|
2021-01-30 00:30:13 +03:00
|
|
|
path: target/upload/*
|
|
|
|
|
2022-04-29 18:27:17 +03:00
|
|
|
release-macos-x64:
|
2021-01-30 00:30:13 +03:00
|
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2022-05-17 11:04:49 +03:00
|
|
|
uses: actions/checkout@v3
|
2021-01-30 00:30:13 +03:00
|
|
|
- name: Install Rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
profile: minimal
|
2021-02-01 23:49:34 +03:00
|
|
|
- name: Environment
|
2021-02-01 23:57:36 +03:00
|
|
|
run: |
|
2021-02-01 23:49:34 +03:00
|
|
|
uname -a
|
|
|
|
cargo --version
|
2021-01-30 00:30:13 +03:00
|
|
|
- name: set Version
|
|
|
|
run: |
|
|
|
|
echo VERSION=$(grep '^version' packages/hurl/Cargo.toml | cut -f2 -d'"') >> $GITHUB_ENV
|
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
ci/man.sh
|
|
|
|
ci/release.sh
|
2022-04-29 18:27:17 +03:00
|
|
|
ci/create_tarball.sh macos
|
2021-01-30 00:30:13 +03:00
|
|
|
- name: Archive production artifacts
|
2022-05-17 11:04:53 +03:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-01-30 00:30:13 +03:00
|
|
|
with:
|
2022-04-29 18:27:17 +03:00
|
|
|
name: release-macos-x64-artifacts
|
2021-01-30 00:30:13 +03:00
|
|
|
path: target/upload/*
|
2021-02-23 19:37:41 +03:00
|
|
|
|
2021-11-25 12:25:00 +03:00
|
|
|
release-windows-x64:
|
2021-02-23 19:37:41 +03:00
|
|
|
runs-on: windows-latest
|
|
|
|
env:
|
|
|
|
VCPKGRS_DYNAMIC: 1
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2022-05-19 17:11:07 +03:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
- uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
C:\vcpkg\installed
|
2022-05-21 20:40:41 +03:00
|
|
|
key: ${{ runner.os }}-release-windows-x64-${{ github.sha }}
|
|
|
|
restore-keys: ${{ runner.os }}-release-windows-x64-
|
2021-02-23 19:37:41 +03:00
|
|
|
- name: Install Rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
profile: minimal
|
|
|
|
- name: Environment
|
|
|
|
run: |
|
|
|
|
$Properties = 'Caption', 'CSName', 'Version', 'BuildType', 'OSArchitecture'
|
|
|
|
Get-CimInstance Win32_OperatingSystem | Select-Object $Properties | Format-Table -AutoSize
|
|
|
|
cargo --version
|
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
# vcpkg build prequisites
|
|
|
|
(Get-Command vcpkg).Path
|
2022-05-19 17:11:07 +03:00
|
|
|
if (Test-Path C:\vcpkg\installed) {vcpkg update} else {vcpkg install libxml2:x64-windows}
|
2021-02-23 19:37:41 +03:00
|
|
|
vcpkg integrate install
|
|
|
|
refreshenv
|
|
|
|
# fix known win build bugs
|
|
|
|
(Get-Content .\packages\hurl\src\runner\hurl_file.rs).replace('```', '') | Set-Content .\packages\hurl\src\runner\hurl_file.rs
|
|
|
|
# build release
|
|
|
|
cargo build --release --verbose
|
|
|
|
New-Item -ItemType Directory -Name .\target\win-package
|
|
|
|
Get-ChildItem -Path '.\target\release' -Recurse -Include *.dll -File | Copy-Item -Destination '.\target\win-package'
|
|
|
|
Get-ChildItem -Path '.\target\release' -Recurse -Include hurl*.exe -File | Copy-Item -Destination '.\target\win-package'
|
|
|
|
((.\target\win-package\hurl.exe --version) -Split " ")[1] > .\target\win-package\version.txt
|
|
|
|
Get-ChildItem .\target\win-package
|
|
|
|
Get-Content .\target\win-package\version.txt
|
|
|
|
- name: Create Zip package and win64 installer
|
|
|
|
run: |
|
|
|
|
# create zip
|
|
|
|
$hurl_package_version = Get-Content .\target\win-package\version.txt
|
|
|
|
cd .\target\win-package
|
2021-10-11 19:17:19 +03:00
|
|
|
Get-ChildItem -Path *.dll, *hurl.exe, *hurlfmt.exe, *.txt, ../../*.md -Exclude hex_literal* | Compress-Archive -DestinationPath hurl-${hurl_package_version}-win64.zip
|
2021-02-23 19:37:41 +03:00
|
|
|
Get-ChildItem .\*win64.zip
|
|
|
|
cd ..\..
|
|
|
|
# create installer
|
|
|
|
choco install --confirm --no-progress nsis
|
2021-10-07 14:49:55 +03:00
|
|
|
refreshenv
|
|
|
|
Get-Command Expand-Archive
|
|
|
|
Expand-Archive -Path '.\ci\windows\EnVar_plugin.zip' -DestinationPath 'C:\Program Files (x86)\NSIS' -Verbose
|
2021-02-23 19:37:41 +03:00
|
|
|
cd .\target\win-package
|
|
|
|
makensis.exe /NOCD /V4 ..\..\ci\windows\hurl.nsi
|
|
|
|
- name: Archive production artifacts
|
2022-05-17 11:04:53 +03:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-02-23 19:37:41 +03:00
|
|
|
with:
|
2021-11-25 12:25:00 +03:00
|
|
|
name: release-windows-x64-artifacts
|
2021-02-23 19:37:41 +03:00
|
|
|
path: |
|
2021-03-03 16:43:55 +03:00
|
|
|
.\target\win-package\hurl-*-installer.exe
|
2022-05-21 20:40:41 +03:00
|
|
|
.\target\win-package\hurl-*-win64.zip
|