From 6a2a10553c8a3e54589dc30d64e6eeb24bd6e19d Mon Sep 17 00:00:00 2001 From: Jason Gross Date: Thu, 9 Nov 2023 12:15:19 -0800 Subject: [PATCH] [CI] Upload standalone archives to releases --- .github/workflows/coq-alpine.yml | 62 +++++++++++++++++++++++++++++++ .github/workflows/coq-debian.yml | 62 +++++++++++++++++++++++++++++++ .github/workflows/coq-macos.yml | 62 +++++++++++++++++++++++++++++++ .github/workflows/coq-windows.yml | 59 +++++++++++++++++++++++++++++ .github/workflows/docker-coq.yml | 62 +++++++++++++++++++++++++++++++ 5 files changed, 307 insertions(+) diff --git a/.github/workflows/coq-alpine.yml b/.github/workflows/coq-alpine.yml index 6ab7f719ae4..61595595f42 100644 --- a/.github/workflows/coq-alpine.yml +++ b/.github/workflows/coq-alpine.yml @@ -6,6 +6,8 @@ on: pull_request: merge_group: workflow_dispatch: + release: + types: [published] schedule: - cron: '0 0 1 * *' @@ -91,6 +93,66 @@ jobs: - name: display per-line timing info run: etc/ci/github-actions-display-per-line-timing.sh + test-standalone-alpine: + runs-on: ubuntu-latest + needs: build + steps: + - uses: actions/checkout@v4 + - name: Download standalone edge + uses: actions/download-artifact@v3 + with: + name: standalone-edge + path: dist-edge/ + - name: List files + run: find dist-edge + - name: Rename files + run: | + mkdir dist + mv dist-edge/standalone.tar.gz dist/fiat-crypto-alpine-edge.tar.gz + find dist + tar -tvf dist/fiat-crypto-alpine-edge.tar.gz + - name: Unpack and Test files + run: | + cd dist + tar -xzvf fiat-crypto-alpine-edge.tar.gz + ls -la . + for prog in word_by_word_montgomery unsaturated_solinas saturated_solinas base_conversion; do + echo "::group::$prog" + ./$prog -h + echo "::endgroup::" + done + + publish-standalone: + runs-on: ubuntu-latest + needs: build + permissions: + contents: write # IMPORTANT: mandatory for making GitHub Releases + steps: + - uses: actions/checkout@v4 + - name: Download standalone edge + uses: actions/download-artifact@v3 + with: + name: standalone-edge + path: dist-edge/ + - name: List files + run: find dist-edge + - name: Unpack files + run: | + mkdir dist + mv dist-edge/standalone.tar.gz dist/fiat-crypto-alpine-edge.tar.gz + find dist + tar -tvf dist/fiat-crypto-alpine-edge.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' }} + alpine-check-all: runs-on: ubuntu-latest needs: [build] diff --git a/.github/workflows/coq-debian.yml b/.github/workflows/coq-debian.yml index 774f3725bd4..428f1eccc5e 100644 --- a/.github/workflows/coq-debian.yml +++ b/.github/workflows/coq-debian.yml @@ -6,6 +6,8 @@ on: pull_request: merge_group: workflow_dispatch: + release: + types: [published] schedule: - cron: '0 0 1 * *' @@ -113,6 +115,66 @@ jobs: env: ALLOW_DIFF: 1 + test-standalone-debian: + runs-on: ubuntu-latest + needs: build + steps: + - uses: actions/checkout@v4 + - name: Download standalone sid + uses: actions/download-artifact@v3 + with: + name: standalone-sid + path: dist-sid/ + - name: List files + run: find dist-sid + - name: Rename files + run: | + mkdir dist + mv dist-sid/standalone.tar.gz dist/fiat-crypto-sid.tar.gz + find dist + tar -tvf dist/fiat-crypto-sid.tar.gz + - name: Unpack and Test files + run: | + cd dist + tar -xzvf fiat-crypto-sid.tar.gz + ls -la . + for prog in word_by_word_montgomery unsaturated_solinas saturated_solinas base_conversion; do + echo "::group::$prog" + ./$prog -h + echo "::endgroup::" + done + + publish-standalone: + runs-on: ubuntu-latest + needs: build + permissions: + contents: write # IMPORTANT: mandatory for making GitHub Releases + steps: + - uses: actions/checkout@v4 + - name: Download standalone sid + uses: actions/download-artifact@v3 + with: + name: standalone-sid + path: dist-sid/ + - name: List files + run: find dist-sid + - name: Unpack files + run: | + mkdir dist + 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' }} + debian-check-all: runs-on: ubuntu-latest needs: [build, test-amd64] diff --git a/.github/workflows/coq-macos.yml b/.github/workflows/coq-macos.yml index 75a3085f94a..cb15b4a4a99 100644 --- a/.github/workflows/coq-macos.yml +++ b/.github/workflows/coq-macos.yml @@ -6,6 +6,8 @@ on: pull_request: merge_group: workflow_dispatch: + release: + types: [published] schedule: - cron: '0 0 1 * *' @@ -96,3 +98,63 @@ jobs: # eval $(opam env) # make TIMED=1 validate COQCHKFLAGS="-o ${COQCHKEXTRAFLAGS}" # if: github.event_name != 'pull_request' + + test-standalone-macos: + runs-on: macos-latest + needs: build-macos + steps: + - uses: actions/checkout@v4 + - name: Download standalone MacOS + uses: actions/download-artifact@v3 + with: + name: standalone-macos + path: dist-macos/ + - name: List files + run: find dist-macos + - name: Rename files + run: | + mkdir dist + mv dist-macos/standalone.tar.gz dist/fiat-crypto-macos.tar.gz + find dist + tar -tvf dist/fiat-crypto-macos.tar.gz + - name: Unpack and Test files + run: | + cd dist + tar -xzvf fiat-crypto-macos.tar.gz + ls -la . + for prog in word_by_word_montgomery unsaturated_solinas saturated_solinas base_conversion; do + echo "::group::$prog" + ./$prog -h + echo "::endgroup::" + done + + publish-standalone: + runs-on: ubuntu-latest + needs: build-macos + permissions: + contents: write # IMPORTANT: mandatory for making GitHub Releases + steps: + - uses: actions/checkout@v4 + - name: Download standalone MacOS + uses: actions/download-artifact@v3 + with: + name: standalone-macos + path: dist-macos/ + - name: List files + run: find dist-macos + - name: Unpack files + run: | + mkdir dist + mv dist-macos/standalone.tar.gz dist/fiat-crypto-macos.tar.gz + find dist + tar -tvf dist/fiat-crypto-macos.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' }} diff --git a/.github/workflows/coq-windows.yml b/.github/workflows/coq-windows.yml index fc7317b7d7f..1e858024523 100644 --- a/.github/workflows/coq-windows.yml +++ b/.github/workflows/coq-windows.yml @@ -9,6 +9,8 @@ on: pull_request: merge_group: workflow_dispatch: + release: + types: [published] schedule: - cron: '0 0 1 * *' @@ -117,3 +119,60 @@ jobs: # %CYGWIN_ROOT%\bin\bash.exe -l -c 'cd "%cd%"; opam exec -- make TIMED=1 validate COQCHKFLAGS="-o ${COQCHKEXTRAFLAGS}"' # shell: cmd # if: github.event_name != 'pull_request' + + test-standalone-windows: + runs-on: windows-latest + needs: build-windows + steps: + - uses: actions/checkout@v4 + - name: Download standalone Windows + uses: actions/download-artifact@v3 + with: + name: standalone-windows + path: dist-windows/ + - name: List files + run: Get-ChildItem dist-windows -Name + - name: Rename files + run: | + New-Item -ItemType Directory -Path dist + Move-Item dist-windows/standalone.zip dist/fiat-crypto-windows.zip + Get-ChildItem dist -Name + - name: Unpack files + run: | + Expand-Archive -Path dist/fiat-crypto-windows.zip -DestinationPath dist + Get-ChildItem dist + - run: .\dist\word_by_word_montgomery.exe -h + - run: .\dist\unsaturated_solinas.exe -h + - run: .\dist\saturated_solinas.exe -h + - run: .\dist\base_conversion.exe -h + + publish-standalone: + runs-on: ubuntu-latest + needs: build-windows + permissions: + contents: write # IMPORTANT: mandatory for making GitHub Releases + steps: + - uses: actions/checkout@v4 + - name: Download standalone Windows + uses: actions/download-artifact@v3 + with: + name: standalone-windows + path: dist-windows/ + - name: List files + run: find dist-windows + - name: Unpack files + run: | + mkdir dist + mv dist-windows/standalone.zip dist/fiat-crypto-windows.zip + find dist + unzip -l dist/fiat-crypto-windows.zip + - 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' }} diff --git a/.github/workflows/docker-coq.yml b/.github/workflows/docker-coq.yml index fd78b23d8ef..4c19cdabcd9 100644 --- a/.github/workflows/docker-coq.yml +++ b/.github/workflows/docker-coq.yml @@ -6,6 +6,8 @@ on: pull_request: merge_group: workflow_dispatch: + release: + types: [published] schedule: - cron: '0 0 1 * *' @@ -131,3 +133,63 @@ jobs: run: etc/ci/github-actions-make.sh -f Makefile.examples -j2 only-test-amd64-files SLOWEST_FIRST=1 env: ALLOW_DIFF: 1 + + test-standalone-docker: + runs-on: ubuntu-latest + needs: docker-build + steps: + - uses: actions/checkout@v4 + - name: Download standalone Docker + uses: actions/download-artifact@v3 + with: + name: standalone-docker-coq-dev + path: dist-docker-coq-dev/ + - name: List files + run: find dist-docker-coq-dev + - name: Rename files + run: | + mkdir dist + 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: Unpack and Test files + run: | + cd dist + tar -xzvf fiat-crypto-docker-coq-dev.tar.gz + ls -la . + for prog in word_by_word_montgomery unsaturated_solinas saturated_solinas base_conversion; do + echo "::group::$prog" + ./$prog -h + echo "::endgroup::" + done + + publish-standalone: + runs-on: ubuntu-latest + needs: docker-build + permissions: + contents: write # IMPORTANT: mandatory for making GitHub Releases + steps: + - uses: actions/checkout@v4 + - name: Download standalone Docker + uses: actions/download-artifact@v3 + with: + name: standalone-docker-coq-dev + path: dist-docker-coq-dev/ + - name: List files + run: find dist-docker-coq-dev + - name: Unpack files + run: | + mkdir dist + 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' }}