hurl/.github/workflows/release.yml
2022-07-31 09:59:10 +02:00

117 lines
4.0 KiB
YAML

name: release
on: [pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
release-generic-linux-x64:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install
run: |
bin/install_prerequisites_ubuntu.sh
bin/install_rust_latest.sh
- name: set Version
run: bin/release/version.sh
- name: Build
run: |
bin/release/man.sh
bin/release/release.sh
bin/release/create_tarball.sh linux
- name: Create deb
run: bin/release/deb.sh
- name: Archive production artifacts (tarball)
uses: actions/upload-artifact@v3
with:
name: release-linux-x64-artifacts
path: target/upload/*
release-macos-x64:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust
run: |
bin/install_rust_latest.sh
- name: set Version
run: bin/release/version.sh
- name: Build
run: |
bin/release/man.sh
bin/release/release.sh
bin/release/create_tarball.sh macos
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: release-macos-x64-artifacts
path: target/upload/*
release-windows-x64:
runs-on: windows-latest
env:
VCPKGRS_DYNAMIC: 1
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
C:\vcpkg\installed
key: ${{ runner.os }}-release-windows-x64-${{ github.sha }}
restore-keys: ${{ runner.os }}-release-windows-x64-
- 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
if (Test-Path C:\vcpkg\installed) {vcpkg update} else {vcpkg install libxml2:x64-windows}
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, *hurlfmt.exe, *.txt, ../../*.md -Exclude hex_literal* | Compress-Archive -DestinationPath hurl-${hurl_package_version}-win64.zip
Get-ChildItem .\*win64.zip
cd ..\..
# create installer
choco install --confirm --no-progress nsis
refreshenv
Get-Command Expand-Archive
Expand-Archive -Path '.\bin\windows\EnVar_plugin.zip' -DestinationPath 'C:\Program Files (x86)\NSIS' -Verbose
cd .\target\win-package
makensis.exe /NOCD /V4 ..\..\bin\windows\hurl.nsi
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: release-windows-x64-artifacts
path: |
.\target\win-package\hurl-*-installer.exe
.\target\win-package\hurl-*-win64.zip