diff --git a/.github/workflows/generate-current-manifests.yml b/.github/workflows/generate-current-manifests.yml index ff58d2be..deefacc1 100644 --- a/.github/workflows/generate-current-manifests.yml +++ b/.github/workflows/generate-current-manifests.yml @@ -14,11 +14,13 @@ on: jobs: generate: - name: generate-manifests + name: generate-and-upload-manifests runs-on: ubuntu-latest env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} SCHEMATIC_SERVICE_ACCOUNT_CREDS: ${{ secrets.SCHEMATIC_SERVICE_ACCOUNT_CREDS }} + SYNAPSE_AUTH_TOKEN: ${{ secrets.SYNAPSE_TOKEN_DPE }} + SYNAPSE_UPLOAD_FOLDER_ID: syn25878249 steps: - uses: actions/checkout@v4 @@ -55,3 +57,7 @@ jobs: reviewers: $$ {github.actor }} draft: false delete-branch: true + + - name: Upload all manifests + working-directory: current-excel-manifests + run: ../tests/upload_templates.sh \ No newline at end of file diff --git a/tests/upload_templates.sh b/tests/upload_templates.sh new file mode 100755 index 00000000..65962216 --- /dev/null +++ b/tests/upload_templates.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# upload metadata templates to synapse +# if running locally set SYNAPSE_AUTH_TOKEN in your environment + +set -e +shopt -s extglob + +echo Uploading manifests to "${SYNAPSE_UPLOAD_FOLDER_ID}" + +MANIFESTS=("$PWD"/*.@(xlsx|xls)) + +for MANIFEST in ${MANIFESTS[@]}; +do + echo "Uploading $MANIFEST" + synapse store --parentId "${SYNAPSE_UPLOAD_FOLDER_ID}" --noForceVersion "$MANIFEST" +done + +echo "✓ Done!" \ No newline at end of file