Skip to content

Commit

Permalink
use env var
Browse files Browse the repository at this point in the history
  • Loading branch information
Alek Petuskey authored and Alek Petuskey committed Jun 20, 2024
1 parent b1e0ba1 commit 47811d5
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/create-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 47811d5

Please sign in to comment.