name: "Distribute upload" description: "Uploads the package from the dist dir to GitHub artifacts or Google Drive" inputs: use_github: description: "Whether to upload to GitHub artifacts" required: true use_gdrive: description: "Whether to upload to Google Drive" required: true github-target-filename: description: "Filename to upload (GitHub artifacts)" required: true gdrive-target-base-dir: description: "Base directory to upload (Google Drive)" required: true gdrive-secret-key: description: "Google Drive secret key" required: true gdrive-parent-folder-id: description: "Google Drive parent folder ID" required: true package-version: description: "Package version appended to the Google Drive dir" required: true runs: using: "composite" steps: - if: ${{ inputs.use_gdrive == inputs.use_github }} run: | echo "Either 'use_github' or 'use_gdrive' must be true (and not both)" exit 1 shell: bash - if: ${{ inputs.use_gdrive == 'true' && !inputs.package-version }} run: | echo "Input 'package-version' is required when uploading to Google Drive" exit 1 shell: bash - if: ${{ inputs.use_gdrive == 'true' }} run: | SHORT_VERSION=$(echo "${{ inputs.package-version }}" | cut -d'-' -f1) echo "SHORT_VERSION=$SHORT_VERSION" >> $GITHUB_ENV shell: bash - name: Upload to GitHub if: ${{ inputs.use_github == 'true' }} uses: actions/upload-artifact@v4 with: name: ${{ inputs.github-target-filename }} path: ./dist retention-days: 3 - name: Upload to Google Drive if: ${{ inputs.use_gdrive == 'true' }} uses: symless/gdrive-upload@target-glob with: credentials: ${{ inputs.gdrive-secret-key }} target: "./dist/*" parent_folder_id: ${{ inputs.gdrive-parent-folder-id }} child_folder: Packages/${{ inputs.gdrive-target-base-dir }}/${{ env.SHORT_VERSION }}/${{ inputs.package-version }}