Skip to content

Commit

Permalink
Only upload one copy of linux binaries to releases
Browse files Browse the repository at this point in the history
We upload the statically-linked Alpine edge binaries, as these are
probably the most portable.

Note that the statically-linked Alpine binaries are actually smaller
than the Debian executables (~35 MB archive vs ~41 MB archive), though
the Debian ones are pie (position-independent executables, supporting
Address Space Layout Randomization).
  • Loading branch information
JasonGross committed Nov 13, 2023
1 parent 352189c commit 5b5f200
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 37 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/coq-alpine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,28 @@ jobs:
- name: Unpack files
run: |
mkdir dist
mv dist-edge/standalone.tar.gz dist/fiat-crypto-alpine-edge.tar.gz
echo "::group::find arch"
cd dist-edge
tar -xzvf standalone.tar.gz
file word_by_word_montgomery
file_info="$(file word_by_word_montgomery 2>&1)"
case "${file_info}" in
*x86-64*)
arch=x86_64
;;
*)
arch=unknown
echo "::warning::Unknown architecture ${file_info} (using ${arch})"
;;
esac
cd ..
echo "::endgroup::"
tag="$(git describe --tags $(git rev-parse HEAD))"
fname="Fiat-Cryptography_${tag}_Linux_${arch}.tar.gz"
echo "$fname"
mv dist-edge/standalone.tar.gz "dist/$fname"
find dist
tar -tvf dist/fiat-crypto-alpine-edge.tar.gz
tar -tvf "dist/$fname"
- name: Upload artifacts to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/coq-debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ jobs:
echo "::endgroup::"
done
publish-standalone:
publish-standalone-dry-run:
runs-on: ubuntu-latest
needs: build
permissions:
Expand All @@ -196,20 +196,20 @@ jobs:
mv dist-sid/standalone.tar.gz dist/fiat-crypto-sid.tar.gz
find dist
tar -tvf dist/fiat-crypto-sid.tar.gz
- name: Upload artifacts to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name == 'release' }}
# - name: Upload artifacts to GitHub Release
# env:
# GITHUB_TOKEN: ${{ github.token }}
# # Upload to GitHub Release using the `gh` CLI.
# # `dist/` contains the built packages
# run: >-
# gh release upload
# '${{ github.ref_name }}' dist/**
# --repo '${{ github.repository }}'
# if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name == 'release' }}

debian-check-all:
runs-on: ubuntu-latest
needs: [build, test-amd64, test-standalone, publish-standalone]
needs: [build, test-amd64, test-standalone, publish-standalone-dry-run]
if: always()
steps:
- run: echo 'build passed'
Expand All @@ -218,13 +218,13 @@ jobs:
if: ${{ needs.test-amd64.result == 'success' }}
- run: echo 'test-standalone passed'
if: ${{ needs.test-standalone == 'success' }}
- run: echo 'publish-standalone passed'
if: ${{ needs.publish-standalone.result == 'success' }}
- run: echo 'publish-standalone-dry-run passed'
if: ${{ needs.publish-standalone-dry-run.result == 'success' }}
- run: echo 'build failed' && false
if: ${{ needs.build.result != 'success' }}
- run: echo 'test-amd64 failed' && false
if: ${{ needs.test-amd64.result != 'success' }}
- run: echo 'test-standalone failed' && false
if: ${{ needs.test-standalone != 'success' }}
- run: echo 'publish-standalone failed' && false
if: ${{ needs.publish-standalone.result != 'success' }}
- run: echo 'publish-standalone-dry-run failed' && false
if: ${{ needs.publish-standalone-dry-run.result != 'success' }}
32 changes: 16 additions & 16 deletions .github/workflows/coq-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ jobs:
echo "::endgroup::"
done
publish-standalone:
publish-standalone-dry-run:
runs-on: ubuntu-latest
needs: build
permissions:
Expand All @@ -218,20 +218,20 @@ jobs:
mv dist-docker-coq-dev/standalone.tar.gz dist/fiat-crypto-docker-coq-dev.tar.gz
find dist
tar -tvf dist/fiat-crypto-docker-coq-dev.tar.gz
- name: Upload artifacts to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name == 'release' }}
# - name: Upload artifacts to GitHub Release
# env:
# GITHUB_TOKEN: ${{ github.token }}
# # Upload to GitHub Release using the `gh` CLI.
# # `dist/` contains the built packages
# run: >-
# gh release upload
# '${{ github.ref_name }}' dist/**
# --repo '${{ github.repository }}'
# if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name == 'release' }}

docker-check-all:
runs-on: ubuntu-latest
needs: [build, test-amd64, test-standalone, publish-standalone]
needs: [build, test-amd64, test-standalone, publish-standalone-dry-run]
if: always()
steps:
- run: echo 'build passed'
Expand All @@ -240,13 +240,13 @@ jobs:
if: ${{ needs.test-amd64.result == 'success' }}
- run: echo 'test-standalone passed'
if: ${{ needs.test-standalone == 'success' }}
- run: echo 'publish-standalone passed'
if: ${{ needs.publish-standalone.result == 'success' }}
- run: echo 'publish-standalone-dry-run passed'
if: ${{ needs.publish-standalone-dry-run.result == 'success' }}
- run: echo 'build failed' && false
if: ${{ needs.build.result != 'success' }}
- run: echo 'test-amd64 failed' && false
if: ${{ needs.test-amd64.result != 'success' }}
- run: echo 'test-standalone failed' && false
if: ${{ needs.test-standalone != 'success' }}
- run: echo 'publish-standalone failed' && false
if: ${{ needs.publish-standalone.result != 'success' }}
- run: echo 'publish-standalone-dry-run failed' && false
if: ${{ needs.publish-standalone-dry-run.result != 'success' }}
23 changes: 22 additions & 1 deletion .github/workflows/coq-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,28 @@ jobs:
- name: Unpack files
run: |
mkdir dist
mv dist-macos/standalone.tar.gz dist/fiat-crypto-macos.tar.gz
echo "::group::find arch"
cd dist-macos
tar -xzvf standalone.tar.gz
file word_by_word_montgomery
otool -L word_by_word_montgomery
lipo -info word_by_word_montgomery
file_info="$(file word_by_word_montgomery 2>&1)"
case "${file_info}" in
*x86_64*)
arch=x86_64
;;
*)
arch="$(printf "%s\n" "${file_info}" | awk '{print $NF}')"
echo "::warning::Unknown architecture ${file_info} (using ${arch})"
;;
esac
cd ..
echo "::endgroup::"
tag="$(git describe --tags $(git rev-parse HEAD))"
fname="Fiat-Cryptography_${tag}_macOS_${arch}.tar.gz"
echo "$fname"
mv dist-macos/standalone.tar.gz "dist/$fname"
find dist
tar -tvf dist/fiat-crypto-macos.tar.gz
- name: Upload artifacts to GitHub Release
Expand Down
23 changes: 21 additions & 2 deletions .github/workflows/coq-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,28 @@ jobs:
- name: Unpack files
run: |
mkdir dist
mv dist-windows/standalone.zip dist/fiat-crypto-windows.zip
echo "::group::find arch"
cd dist-windows
unzip standalone.zip
file word_by_word_montgomery
file_info="$(file word_by_word_montgomery 2>&1)"
case "${file_info}" in
*x86_64*)
arch=x86_64
;;
*)
arch=x86_64
echo "::warning::Unknown architecture ${file_info} (using ${arch})"
;;
esac
cd ..
echo "::endgroup::"
tag="$(git describe --tags $(git rev-parse HEAD))"
fname="Fiat-Cryptography_${tag}_Windows_${arch}.zip"
echo "$fname"
mv dist-windows/standalone.zip "dist/$fname"
find dist
unzip -l dist/fiat-crypto-windows.zip
unzip -l "dist/$fname"
- name: Upload artifacts to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
Expand Down

0 comments on commit 5b5f200

Please sign in to comment.