Skip to content

Commit 8bc161c

Browse files
committed
fix: upload assets release job
1 parent 058b9fb commit 8bc161c

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

.github/workflows/asset-release.yml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ name: Add Release Assets
33
on:
44
release:
55
types: [published]
6-
6+
workflow_dispatch:
7+
inputs:
8+
tag:
9+
description: 'Tag to generate documentation for'
10+
required: false
711
jobs:
812
asset:
913
runs-on: ${{ matrix.operating-system }}
@@ -18,12 +22,6 @@ jobs:
1822
name: Get Tag
1923
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
2024

21-
- name: Get release
22-
id: get_release
23-
uses: bruceadams/[email protected]
24-
env:
25-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26-
2725
- name: Checkout
2826
uses: actions/checkout@v2
2927

@@ -50,14 +48,11 @@ jobs:
5048
zip -d ${fileName} "tests*" || true &&
5149
zip -d ${fileName} "examples*" || true
5250
env:
53-
fileName: google-api-php-client-${{ steps.tagName.outputs.tag }}-PHP${{ matrix.php }}.zip
51+
fileName: google-api-php-client-${{ inputs.tag || steps.tagName.outputs.tag }}-PHP${{ matrix.php }}.zip
5452

5553
- name: Upload Release Archive
56-
uses: actions/upload-release-asset@v1
57-
env:
58-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
54+
uses: softprops/action-gh-release@v2
55+
if: github.ref_type == 'tag'
5956
with:
60-
upload_url: ${{ steps.get_release.outputs.upload_url }}
61-
asset_path: ./google-api-php-client-${{ steps.tagName.outputs.tag }}-PHP${{ matrix.php }}.zip
62-
asset_name: google-api-php-client-${{ steps.tagName.outputs.tag }}-PHP${{ matrix.php }}.zip
63-
asset_content_type: application/zip
57+
files: |
58+
./google-api-php-client-${{ inputs.tag || steps.tagName.outputs.tag }}-PHP${{ matrix.php }}.zip

0 commit comments

Comments
 (0)