Use active toolchain to set release packages names

This commit is contained in:
lepapareil 2023-09-12 11:47:26 +02:00
parent 8d9b7fc36f
commit 1867c410ac
No known key found for this signature in database
GPG Key ID: F4F06B068FB00692
14 changed files with 34 additions and 29 deletions

View File

@ -5,5 +5,5 @@ docker_file="$1"
version="2.12.0"
wget --quiet --output-document /tmp/hadolint "https://github.com/hadolint/hadolint/releases/download/v${version}/hadolint-Linux-x86_64"
chmod +x /tmp/hadolint
/tmp/hadolint --verbose "${docker_file}"
/tmp/hadolint --verbose --ignore DL3018 --ignore SC1091 "${docker_file}"

View File

@ -42,5 +42,7 @@ sudo apt-get install -y lintian
lintian --verbose target/debian.deb
mkdir -p target/upload
cp target/debian.deb "target/upload/hurl_${VERSION}_amd64.deb"
toolchain=$(bin/release/get_active_toolchain.sh)
echo "toolchain=${toolchain}"
cp target/debian.deb "target/upload/hurl_${VERSION}_${toolchain}.deb"

View File

@ -1,11 +1,10 @@
#!/bin/bash
set -Eeuo pipefail
os=$(uname -a | cut -d ' ' -f 1 | tr "[:upper:]" "[:lower:]")
echo "os=${os}"
arch="$(uname -m)"
echo "arch=${arch}"
package_signature="${VERSION}-${arch}-${os}"
toolchain=$(bin/release/get_active_toolchain.sh)
echo "toolchain=${toolchain}"
package_signature="${VERSION}-${toolchain}"
echo "package_signature=${package_signature=}"
package_dir="target/tarball/hurl-${package_signature}"
echo "package_dir=${package_dir}"
tarball_file="hurl-${package_signature}.tar.gz"

View File

@ -7,10 +7,11 @@ $actual_dir=(Get-Location).Path
# get built hurl version
$hurl_package_version = Get-Content .\target\win-package\version.txt
$toolchain=((((rustup show active-toolchain) -Split " ")[0]) -Split "-",2)[1]
# create windows64 zip package
cd $PSScriptRoot\..\..\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 -Path *.dll, *hurl.exe, *hurlfmt.exe, *.txt, ../../*.md -Exclude hex_literal* | Compress-Archive -DestinationPath hurl-${hurl_package_version}-${toolchain}.zip
Get-ChildItem .\*win64.zip
cd $actual_dir

View File

@ -0,0 +1,6 @@
#!/bin/bash
set -Eeuo pipefail
toolchain=$(rustup show active-toolchain | cut -d '-' -f 2- | cut -d ' ' -f1)
echo "${toolchain}"

View File

@ -4,7 +4,7 @@ set -Eeuo pipefail
echo "----- install deb package -----"
# install
deb_package=$(ls target/upload/hurl_*_amd64.deb)
deb_package=$(ls target/upload/hurl_*.deb)
echo "$deb_package"
install_dir="/tmp/hurl-deb-package"
mkdir -p "${install_dir}"

View File

@ -4,12 +4,10 @@ set -Eeuo pipefail
echo "----- install generic linux package -----"
# install
os=$(uname -a | cut --delimiter ' ' --field 1 | tr "[:upper:]" "[:lower:]")
echo "os=${os}"
arch="$(uname -m)"
echo "arch=${arch}"
generic_linux_package=$(ls target/upload/hurl-*-"${arch}"-"${os}".tar.gz)
generic_linux_package=$(ls target/upload/hurl-*-*.tar.gz)
echo "generic_linux_package=${generic_linux_package}"
install_dir="/tmp/hurl-generic-linux"
echo "install_dir=${install_dir}"
mkdir -p "${install_dir}"
tar xvf "${generic_linux_package}" -C "${install_dir}" --strip-components=1

View File

@ -4,13 +4,13 @@ set -Eeuo pipefail
echo "----- install generic macos package -----"
# install
os=$(uname -a | cut -d ' ' -f 1 | tr "[:upper:]" "[:lower:]")
echo "os=${os}"
arch="$(uname -m)"
echo "arch=${arch}"
generic_macos_package=$(ls target/upload/hurl-*-"${arch}"-"${os}".tar.gz)
toolchain=$(bin/release/get_active_toolchain.sh)
echo "toolchain=${toolchain}"
generic_macos_package=$(ls target/upload/hurl-*-"${toolchain}".tar.gz)
echo "generic_macos_package=${generic_macos_package}"
install_dir="/tmp/hurl-generic-macos"
echo "install_dir=${install_dir}"
mkdir -p "${install_dir}"
tar xvf "${generic_macos_package}" -C "${install_dir}" --strip-components=1

View File

@ -8,7 +8,7 @@ $project_root_path=(Resolve-Path -LiteralPath $PSScriptRoot\..\..).path
# install windows64 installer
$package_dir="$project_root_path\target\win-package"
Start-Process powershell "$package_dir\*win64-installer.exe /S" -NoNewWindow -Wait -PassThru
Start-Process powershell "$package_dir\*installer.exe /S" -NoNewWindow -Wait -PassThru
if ($LASTEXITCODE) { Throw }
# refresh env

View File

@ -19,7 +19,7 @@ Name "hurl ${VERSION}"
; The file to write
OutFile "hurl-${VERSION}-win64-installer.exe"
OutFile "hurl-${VERSION}-x86_64-pc-windows-msvc-installer.exe"
; Request application privileges for Windows Vista and higher
RequestExecutionLevel admin

View File

@ -57,7 +57,7 @@ bin/release/release.sh
export PATH="${PWD}/target/release:${PATH}"
export VERSION=$(bin/release/get_version.sh)
bin/release/man.sh
bin/release/create_tarball.sh linux arm64
bin/release/create_tarball.sh linux
```
## Test generic linux arm64 package

View File

@ -2,15 +2,14 @@ FROM --platform=$TARGETPLATFORM alpine:3.17 AS builder
ARG TARGETPLATFORM
WORKDIR /tmp/hurl-docker
COPY . /tmp/hurl-docker
# hadolint ignore=DL3018
RUN apk add --no-cache bash git && \
if [ "${TARGETPLATFORM}" = "linux/arm64" ] ; then \
apk add --no-cache -y g++-aarch64-linux-gnu libc6-dev-arm64-cross ; \
source bin/export_cross_compile_env.sh ; \
fi ; \
bash -c bin/install_prerequisites_alpine.sh && \
bash -c bin/install_rust.sh && \
bash -c ./bin/release/release.sh
bash -c "bin/install_prerequisites_alpine.sh" && \
bash -c "bin/install_rust.sh" && \
bash -c "./bin/release/release.sh"
FROM --platform=$TARGETPLATFORM alpine:3.17 AS runner
ARG docker_build_date

View File

@ -7,10 +7,10 @@ $hurl_latest_version=((Invoke-WebRequest -UseBasicParsing https://api.github.com
echo ${hurl_latest_version}
```
Get latest released hurl-x.y.z-win64.zip file's sha256 sum
Get latest released hurl-x.y.z-x86_64-pc-windows-msvc.zip file's sha256 sum
```
Invoke-WebRequest -UseBasicParsing https://github.com/Orange-OpenSource/hurl/releases/download/${hurl_latest_version}/hurl-${hurl_latest_version}-win64.zip -OutFile C:\Windows\Temp\hurl-latest-win64.zip
Invoke-WebRequest -UseBasicParsing https://github.com/Orange-OpenSource/hurl/releases/download/${hurl_latest_version}/hurl-${hurl_latest_version}-x86_64-pc-windows-msvc.zip -OutFile C:\Windows\Temp\hurl-latest-win64.zip
$hurl_latest_sha=(Get-FileHash C:\Windows\Temp\hurl-latest-win64.zip).Hash
echo ${hurl_latest_sha}
```

View File

@ -5,7 +5,7 @@ $SoftwareName = 'hurl'
$HashArguments = @{
PackageName = $env:ChocolateyPackageName
UnzipLocation = $(Split-Path -Parent $MyInvocation.MyCommand.Definition)
Url64 = 'https://github.com/Orange-OpenSource/hurl/releases/download/${hurl_latest_version}/hurl-${hurl_latest_version}-win64.zip'
Url64 = 'https://github.com/Orange-OpenSource/hurl/releases/download/${hurl_latest_version}/hurl-${hurl_latest_version}-x86_64-pc-windows-msvc.zip'
Checksum64 = '${hurl_latest_sha}'
ChecksumType64 = 'sha256'
}