Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/create-tarballs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Create tarballs

on:
push:
pull_request:
workflow_dispatch:

jobs:
Linux:
strategy:
fail-fast: true
matrix:
os:
- name: debian
version: base

runs-on: ubuntu-latest
container:
image: debian:trixie
env:
SDK_VERSION_STANDALONE: 1.4.325.0
SDK_VERSION_REPO: 1.4.309

defaults:
run:
shell: bash

steps:
- name: show env
run: env
- name: Install dependencies
run: |
apt-get update
apt-get upgrade -y
apt-get install -y \
git \
gettext-base

- name: Check Out Code
uses: actions/checkout@v4
with:
submodules: recursive

- name: Fix missing tags
run: |
git config --global --add safe.directory `pwd`
git submodule foreach 'git fetch --unshallow --tags|| true'
git fetch --unshallow --tags
git submodule update --recursive
./create-tarballs.sh
echo "Checksums"
cat tarballs/*.txt
echo "Extracted versions"
cat release-info.cmake

- name: Create tarballs
run: |
./create-tarballs.sh
echo "Checksums"
cat tarballs/*.txt
echo "Extracted versions"
cat release-info.cmake

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ngscopeclient-source
path: |
tarballs/*
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ asan-build
release-nodebug-build
debug-noopt-build
release-asan-build
tarballs
47 changes: 47 additions & 0 deletions create-tarballs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env bash

#Loosely based on https://www.gnu.org/software/tar/manual/html_section/Reproducibility.html
#Drop the mtime attribute from the files since I was unable to reliably make that reproducible

set -e

export TZ=UTC0
export LANG=C

location="$(dirname -- "$( readlink -f -- "$0"; )";)"
cd "$location"

export NGSCOPECLIENT_PACKAGE_VERSION="$(git describe --always --tags)"
export NGSCOPECLIENT_PACKAGE_VERSION_LONG="$(git describe --always --tags --long)"
export SCOPEHAL_PACKAGE_VERSION="$(cd lib;git describe --always --tags --long)"
cat release-info.cmake.in | envsubst > release-info.cmake

git_file_list=$(git ls-files --recurse-submodules )

TARFLAGS="
--sort=name --format=posix
--pax-option=exthdr.name=%d/PaxHeaders/%f
--pax-option=delete=atime,delete=ctime
--mtime=0
--numeric-owner --owner=0 --group=0
--mode=go+u,go-w
"

git_file_list="$git_file_list release-info.cmake"

GZIPFLAGS="--no-name --best"

rm -Rf tarballs
mkdir "tarballs"

LC_ALL=C tar $TARFLAGS -cf - $git_file_list |
gzip $GZIPFLAGS > "tarballs/ngscopeclient-$NGSCOPECLIENT_PACKAGE_VERSION.tar.gz"

cd tarballs
echo "" > ../digest.txt
for file in *; do
sha256sum $file >> ../digest.txt
ls -s $file >> ../digest.txt
sha256sum $file > $file.sha256sum
done
mv ../digest.txt "ngscopeclient-$NGSCOPECLIENT_PACKAGE_VERSION-manifest.txt"
3 changes: 3 additions & 0 deletions release-info.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set(SCOPEHAL_PACKAGE_VERSION "${SCOPEHAL_PACKAGE_VERSION}" CACHE STRING "scopehal package version override")
set(NGSCOPECLIENT_PACKAGE_VERSION "${NGSCOPECLIENT_PACKAGE_VERSION}" CACHE STRING "ngscopeclient package version override")
set(NGSCOPECLIENT_PACKAGE_VERSION_LONG "${NGSCOPECLIENT_PACKAGE_VERSION_LONG}" CACHE STRING "ngscopeclient long package version override")
Loading