aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2024-02-29 16:16:04 +0000
committerGitHub <noreply@github.com>2024-02-29 16:16:04 +0000
commit88c97cbbd04b3da2740d9007f382e4bfb2804e39 (patch)
treeb8e421e5514738851b23cbe7df5730b160117de8
parent0a5c85f8e3c8ca0dce639b73bb5e4e89ffbe9aa3 (diff)
parent17b1c8d338ac9f6b6bdef2cf32fd472212b515e9 (diff)
Merge pull request #3237 from laytan/macos-self-contained-releases
fix releases being a zip of a zip
-rw-r--r--.github/workflows/nightly.yml8
-rwxr-xr-x[-rw-r--r--]ci/upload_create_nightly.sh16
2 files changed, 18 insertions, 6 deletions
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml
index 4da7d42f7..0a344ebf1 100644
--- a/.github/workflows/nightly.yml
+++ b/.github/workflows/nightly.yml
@@ -107,7 +107,7 @@ jobs:
build_macos_arm:
name: MacOS ARM Build
if: github.repository == 'odin-lang/Odin'
- runs-on: macos-14
+ runs-on: macos-14 # ARM machine
steps:
- uses: actions/checkout@v1
- name: Download LLVM and setup PATH
@@ -190,9 +190,9 @@ jobs:
echo Uploading artifcates to B2
chmod +x ./ci/upload_create_nightly.sh
./ci/upload_create_nightly.sh "$BUCKET" windows-amd64 windows_artifacts/
- ./ci/upload_create_nightly.sh "$BUCKET" ubuntu-amd64 ubuntu_artifacts/
- ./ci/upload_create_nightly.sh "$BUCKET" macos-amd64 macos_artifacts/
- ./ci/upload_create_nightly.sh "$BUCKET" macos-arm64 macos_arm_artifacts/
+ ./ci/upload_create_nightly.sh "$BUCKET" ubuntu-amd64 ubuntu_artifacts/dist.zip
+ ./ci/upload_create_nightly.sh "$BUCKET" macos-amd64 macos_artifacts/dist.zip
+ ./ci/upload_create_nightly.sh "$BUCKET" macos-arm64 macos_arm_artifacts/dist.zip
echo Deleting old artifacts in B2
python3 ci/delete_old_binaries.py "$BUCKET" "$DAYS_TO_KEEP"
diff --git a/ci/upload_create_nightly.sh b/ci/upload_create_nightly.sh
index 754b9b87c..065cb13bf 100644..100755
--- a/ci/upload_create_nightly.sh
+++ b/ci/upload_create_nightly.sh
@@ -1,5 +1,7 @@
#!/bin/bash
+set -e
+
bucket=$1
platform=$2
artifact=$3
@@ -9,5 +11,15 @@ filename="odin-$platform-nightly+$now.zip"
echo "Creating archive $filename from $artifact and uploading to $bucket"
-7z a -bd "output/$filename" -r "$artifact"
-b2 upload-file --noProgress "$bucket" "output/$filename" "nightly/$filename" \ No newline at end of file
+# If this is already zipped up (done before artifact upload to keep permissions in tact), just move it.
+if [ "${artifact: -4}" == ".zip" ]
+then
+ echo "Artifact already a zip"
+ mkdir -p "output"
+ mv "$artifact" "output/$filename"
+else
+ echo "Artifact needs to be zipped"
+ 7z a -bd "output/$filename" -r "$artifact"
+fi
+
+b2 upload-file --noProgress "$bucket" "output/$filename" "nightly/$filename"