mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-11-27 08:19:22 +03:00
121 lines
3.7 KiB
YAML
121 lines
3.7 KiB
YAML
name: releasing
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*'
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUST_BACKTRACE: 1
|
|
VCPKGRS_DYNAMIC: 1
|
|
|
|
jobs:
|
|
release-linux:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
- name: Install Rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
override: true
|
|
profile: minimal
|
|
- name: Check Rust Version
|
|
run: |
|
|
ci/check_version.sh
|
|
- 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
|
|
ci/create_tarball.sh linux
|
|
ci/deb.sh
|
|
- name: Archive production artifacts
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: release-linux-artifacts
|
|
path: target/upload/*
|
|
|
|
release-osx:
|
|
runs-on: macos-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
- name: Install Rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
override: true
|
|
profile: minimal
|
|
- name: Check Rust Version
|
|
run: |
|
|
ci/check_version.sh
|
|
- 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
|
|
ci/create_tarball.sh osx
|
|
- name: Archive production artifacts
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: release-osx-artifacts
|
|
path: target/upload/*
|
|
|
|
release-win64:
|
|
runs-on: windows-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
- name: Install Rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
override: true
|
|
profile: minimal
|
|
- name: Build
|
|
run: |
|
|
# vcpkg build prequisites
|
|
(Get-Command vcpkg).Path
|
|
Expand-Archive -PassThru -Force -LiteralPath .\contrib\windows\vcpkg_installed.zip -DestinationPath C:\vcpkg\
|
|
Get-ChildItem C:\vcpkg\installed
|
|
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
|
|
Get-ChildItem -Path *.dll, *hurl.exe, *.txt | Compress-Archive -DestinationPath hurl_${hurl_package_version}_win64.zip
|
|
Get-ChildItem .\*win64.zip
|
|
cd ..\..
|
|
# create installer
|
|
(Get-Command choco).Path
|
|
choco install --confirm --no-progress nsis
|
|
refreshenv
|
|
cd .\target\win-package
|
|
makensis.exe /NOCD /V4 ..\..\contrib\windows\hurl.nsi
|
|
- name: Archive production artifacts
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: release-win64-artifacts
|
|
path: |
|
|
.\target\win-package\hurl_*_installer.exe
|
|
.\target\win-package\hurl_*_win64.zip
|