Skip to content

fix: upload assets release job #2671

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions .github/workflows/asset-release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
name: Add Release Assets

permissions:
contents: write

on:
release:
types: [published]

workflow_dispatch:
inputs:
tag:
description: 'Tag to generate documentation for'
required: true
upload-on-workflow-dispatch:
description: 'Upload assets?'
required: false
default: "false"
jobs:
asset:
runs-on: ${{ matrix.operating-system }}
Expand All @@ -18,12 +29,6 @@ jobs:
name: Get Tag
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}

- name: Get release
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout
uses: actions/checkout@v2

Expand All @@ -50,14 +55,12 @@ jobs:
zip -d ${fileName} "tests*" || true &&
zip -d ${fileName} "examples*" || true
env:
fileName: google-api-php-client-${{ steps.tagName.outputs.tag }}-PHP${{ matrix.php }}.zip
fileName: google-api-php-client-${{ inputs.tag || steps.tagName.outputs.tag }}-PHP${{ matrix.php }}.zip

- name: Upload Release Archive
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
uses: softprops/action-gh-release@v2
if: github.ref_type == 'tag' || inputs.upload-on-workflow-dispatch == 'true'
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./google-api-php-client-${{ steps.tagName.outputs.tag }}-PHP${{ matrix.php }}.zip
asset_name: google-api-php-client-${{ steps.tagName.outputs.tag }}-PHP${{ matrix.php }}.zip
asset_content_type: application/zip
tag_name: ${{ inputs.tag || steps.tagName.outputs.tag }}
files: |
./google-api-php-client-${{ inputs.tag || steps.tagName.outputs.tag }}-PHP${{ matrix.php }}.zip
Loading