ci: Capture the created PDK as output.

Signed-off-by: Tim 'mithro' Ansell <tansell@google.com>
diff --git a/.github/capture.sh b/.github/capture.sh
new file mode 100644
index 0000000..6756700
--- /dev/null
+++ b/.github/capture.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+# Copyright 2021 Open PDKs Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+SKY130_DIR="$(pwd)/pdks/pdk/sky130A"
+if ! [[ -d $SKY130_DIR ]]; then
+    echo "Missing $SKY130_DIR"
+    exit -1
+fi
+
+# Try to create a deterministic tar file
+# https://reproducible-builds.org/docs/archives/
+mkdir ${GITHUB_WORKSPACE}/output/
+(
+	cd ${SKY130_DIR}
+	tar \
+		--create \
+		--xz \
+		--verbose \
+		\
+		--mtime='2020-05-07 00:00Z' \
+		--sort=name \
+		--owner=0 \
+		--group=0 \
+		--numeric-owner \
+		--pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime \
+		\
+		--file ${GITHUB_WORKSPACE}/output/pdk-SKY130A-${STD_CELL_LIBRARY}.tar.xz .
+)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 93513fa..44869a8 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -38,3 +38,15 @@
     - name: Test
       run: |
         bash .github/test.sh
+
+    - name: Capture
+      if: ${{ always() }}
+      run: |
+        bash .github/capture.sh
+
+    - name: Upload
+      if: ${{ always() }}
+      uses: actions/upload-artifact@v2
+      with:
+        name: ${{ matrix.library }}
+        path: ${{ github.workspace }}/output/**