From 43b059a5798133c1c1b9b06988989443907b040c Mon Sep 17 00:00:00 2001 From: Romein van Buren Date: Thu, 22 Jun 2023 11:37:35 +0200 Subject: [PATCH] CI: updated bundle script --- build/ci_bundle.sh | 31 ++++++++++++++++++++++++++----- build/version2file.js | 8 +++----- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/build/ci_bundle.sh b/build/ci_bundle.sh index a46e484..460fa5f 100644 --- a/build/ci_bundle.sh +++ b/build/ci_bundle.sh @@ -1,6 +1,9 @@ #!/bin/sh -# Available platforms: +# +# This script bundles the binaries generated by GitHub Actions. +# +# Platforms to choose from: # - windows-2019 # - windows-2022 # - macos-11 @@ -8,13 +11,31 @@ # - macos-13 # - ubuntu-20.04 # - ubuntu-22.04 +# +# Bundles to choose from: +# - rolens-macos-11-amd64.tar.gz +# - rolens-macos-11-arm64.tar.gz +# - rolens-macos-12-amd64.tar.gz +# - rolens-macos-12-arm64.tar.gz +# - rolens-macos-13-amd64.tar.gz +# - rolens-macos-13-arm64.tar.gz +# - rolens-ubuntu-20.04-amd64.tar.gz +# - rolens-ubuntu-22.04-amd64.tar.gz +# - rolens-windows-2019-amd64.zip +# - rolens-windows-2019-arm64.zip +# - rolens-windows-2022-amd64.zip +# - rolens-windows-2022-arm64.zip +# +node ./build/version2file.js version=$(<./build/version.txt) mkdir bundle -# mv artifacts/*/rolens-macos-11.zip bundle/ -# mv artifacts/*/rolens-macos-11.zip bundle/ +# macOS binaries +mv artifacts/*/rolens-macos-11-amd64.tar.gz bundle/rolens-$version-macos-amd64.tar.gz +mv artifacts/*/rolens-macos-11-arm64.tar.gz bundle/rolens-$version-macos-arm64.tar.gz -ls -echo "$version" +# Windows binaries +mv artifacts/*/rolens-windows-2019-amd64.zip bundle/rolens-$version-windows-amd64.zip +mv artifacts/*/rolens-windows-2019-arm64.zip bundle/rolens-$version-windows-arm64.zip diff --git a/build/version2file.js b/build/version2file.js index de5d261..a2a23e8 100644 --- a/build/version2file.js +++ b/build/version2file.js @@ -3,11 +3,9 @@ // This script extracts the version number from wails.json in the project root // and writes it to version.txt -const fs = require('fs'); - -fs.writeFileSync( - __dirname+'/version.txt', +require('fs').writeFileSync( + __dirname + '/version.txt', JSON.parse( - fs.readFileSync(__dirname+'/../wails.json') + fs.readFileSync(__dirname + '/../wails.json') ).info.productVersion );