Update Release workflow (#858)
Signed-off-by: Slava <20563034+veaceslavdoina@users.noreply.github.com>
This commit is contained in:
parent
3ae73197c2
commit
8f740b42e6
|
@ -8,11 +8,12 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
cache_nonce: 0 # Allows for easily busting actions/cache caches
|
cache_nonce: 0 # Allows for easily busting actions/cache caches
|
||||||
nim_version: v1.6.14
|
nim_version: pinned
|
||||||
rust_version: 1.78.0
|
rust_version: 1.78.0
|
||||||
binary_base: codex
|
binary_base: codex
|
||||||
|
build_dir: build
|
||||||
nim_flags: '-d:verify_circuit=true'
|
nim_flags: '-d:verify_circuit=true'
|
||||||
upload_to_codex: false
|
windows_libs: 'libstdc++-6.dll libgomp-1.dll libgcc_s_seh-1.dll libwinpthread-1.dll'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# Matrix
|
# Matrix
|
||||||
|
@ -75,13 +76,21 @@ jobs:
|
||||||
|
|
||||||
- name: Release - Build
|
- name: Release - Build
|
||||||
run: |
|
run: |
|
||||||
make NIMFLAGS="--out:${{ env.binary }} ${{ env.nim_flags }}"
|
make NIMFLAGS="--out:${{ env.build_dir }}/${{ env.binary }} ${{ env.nim_flags }}"
|
||||||
|
|
||||||
- name: Release - Upload binaries
|
- name: Release - Libraries
|
||||||
|
run: |
|
||||||
|
if [[ "${{ matrix.os }}" == "windows" ]]; then
|
||||||
|
for lib in ${{ env.windows_libs }}; do
|
||||||
|
cp -v "${MINGW_PREFIX}/bin/${lib}" "${{ env.build_dir }}"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Release - Upload build artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: release-${{ env.binary }}
|
name: release-${{ env.binary }}
|
||||||
path: ${{ env.binary }}
|
path: ${{ env.build_dir }}/
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
# Release
|
# Release
|
||||||
|
@ -100,46 +109,49 @@ jobs:
|
||||||
- name: Release - Compress and checksum
|
- name: Release - Compress and checksum
|
||||||
run: |
|
run: |
|
||||||
cd /tmp/release
|
cd /tmp/release
|
||||||
prepare() {
|
checksum() {
|
||||||
# Checksum
|
|
||||||
arc="${1}"
|
arc="${1}"
|
||||||
sha256sum "${arc}" >"${arc}.sha256"
|
sha256sum "${arc}" >"${arc}.sha256"
|
||||||
|
|
||||||
# Upload to Codex
|
|
||||||
if [[ "${{ env.upload_to_codex }}" == "true" ]]; then
|
|
||||||
codex_endpoints="${{ secrets.CODEX_ENDPOINTS }}"
|
|
||||||
codex_username="${{ secrets.CODEX_USERNAME }}"
|
|
||||||
codex_password="${{ secrets.CODEX_PASSWORD }}"
|
|
||||||
|
|
||||||
for endpoint in ${codex_endpoints}; do
|
|
||||||
echo "::add-mask::${endpoint}"
|
|
||||||
cid=$(curl -X POST \
|
|
||||||
"${endpoint}/api/codex/v1/data" \
|
|
||||||
-u "${codex_username}":"${codex_password}" \
|
|
||||||
-H "content-type: application/octet-stream" \
|
|
||||||
-T "${arc}")
|
|
||||||
|
|
||||||
echo "${cid}" >"${arc}.cid"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Compress and prepare
|
# Compress and prepare
|
||||||
for file in *; do
|
for file in *; do
|
||||||
|
# Exclude libraries
|
||||||
|
if [[ "${file}" != *".dll"* ]]; then
|
||||||
if [[ "${file}" == *".exe"* ]]; then
|
if [[ "${file}" == *".exe"* ]]; then
|
||||||
|
|
||||||
|
# Windows - binary only
|
||||||
arc="${file%.*}.zip"
|
arc="${file%.*}.zip"
|
||||||
zip "${arc}" "${file}"
|
zip "${arc}" "${file}"
|
||||||
rm -f "${file}"
|
checksum "${arc}"
|
||||||
prepare "${arc}"
|
|
||||||
|
# Windows - binary and libs
|
||||||
|
arc="${file%.*}-libs.zip"
|
||||||
|
zip "${arc}" "${file}" ${{ env.windows_libs }}
|
||||||
|
rm -f "${file}" ${{ env.windows_libs }}
|
||||||
|
checksum "${arc}"
|
||||||
else
|
else
|
||||||
|
|
||||||
|
# Linux/macOS
|
||||||
arc="${file}.tar.gz"
|
arc="${file}.tar.gz"
|
||||||
|
chmod 755 "${file}"
|
||||||
tar cfz "${arc}" "${file}"
|
tar cfz "${arc}" "${file}"
|
||||||
rm -f "${file}"
|
rm -f "${file}"
|
||||||
prepare "${arc}"
|
checksum "${arc}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
- name: Release - Upload compressed artifacts and checksums
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: archives-and-checksums
|
||||||
|
path: /tmp/release/
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
/tmp/release/*
|
/tmp/release/*
|
||||||
|
|
Loading…
Reference in New Issue