From 47811d5fba8b2be54f2c8d4fb8022dbc87d0ccc9 Mon Sep 17 00:00:00 2001 From: Alek Petuskey Date: Thu, 20 Jun 2024 14:42:00 -0700 Subject: [PATCH] use env var --- .github/workflows/create-artifacts.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/create-artifacts.yml b/.github/workflows/create-artifacts.yml index d6e3ca7..71d8e18 100644 --- a/.github/workflows/create-artifacts.yml +++ b/.github/workflows/create-artifacts.yml @@ -14,20 +14,19 @@ jobs: - name: Set up GitHub CLI run: | - echo "${{ github.token }}" | gh auth login --with-token + echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token - - name: Create zip files for each subfolder and upload as artifacts - env: - GH_TOKEN: ${{ github.token }} + - name: Create zip files for each subfolder run: | for dir in $(find . -mindepth 1 -maxdepth 1 -type d); do zip_file="${dir##*/}.zip" zip -r "$zip_file" "$dir" + echo "Created $zip_file" + done + + - name: Upload zip files to release + run: | + for zip_file in *.zip; do echo "Uploading $zip_file" - gh api \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - /repos/${{ github.repository }}/actions/artifacts \ - -F name="${dir##*/}" \ - -F file=@"$zip_file" + gh release upload "${{ github.event.release.tag_name }}" "$zip_file" done