Skip to main content

Add a first try at the upload-assets step

ID
9ef9ef7
date
2024-05-17 07:03:06+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
fd745c6
message
Add a first try at the upload-assets step

For #6
changed files
1 file, 27 additions

Changed files

.github/workflows/upload_binaries.yml (362) → .github/workflows/upload_binaries.yml (1107)

diff --git a/.github/workflows/upload_binaries.yml b/.github/workflows/upload_binaries.yml
index 7acb5f3..efb3e22 100644
--- a/.github/workflows/upload_binaries.yml
+++ b/.github/workflows/upload_binaries.yml
@@ -17,3 +17,30 @@ jobs:
           changelog: CHANGELOG.md
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+  upload-assets:
+    strategy:
+      matrix:
+        include:
+          - target: aarch64-apple-darwin
+            os: macos-latest
+          - target: x86_64-apple-darwin
+            os: macos-latest
+    runs-on: ${{ matrix.os }}
+
+    permissions:
+      contents: write
+
+    steps:
+      - uses: actions/checkout@v4
+
+      - name: Compile the Swift script
+        run: swiftc save_safari_webarchive.swift
+
+      - name: Create the zip archive
+        run: zip "save_safari_webarchive.${{ matrix.target }}.zip" save_safari_webarchive
+
+      - name: Puhs the zip file to GitHub releases
+        run: gh release upload "$GITHUB_REF" "save_safari_webarchive.${{ matrix.target }}.zip" --clobber
+        env:
+          GH_TOKEN: ${{ github.token }}