-
Notifications
You must be signed in to change notification settings - Fork 3.6k
66 lines (58 loc) · 2.3 KB
/
Copy pathasset-release.yml
File metadata and controls
66 lines (58 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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 }}
strategy:
matrix:
operating-system: [ ubuntu-latest ]
php: [ "8.1", "8.3" ]
name: Upload Release Assets
steps:
- id: getTag
name: Get Tag
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: Install Dependencies
uses: nick-invision/retry@v1
with:
timeout_minutes: 10
max_attempts: 3
command: composer remove --no-update --dev cache/filesystem-adapter && composer install --no-dev --prefer-dist
- name: Create Archive
run: |
zip -r ${fileName} . &&
zip -d ${fileName} ".git*" || true &&
zip -d ${fileName} "tests*" || true &&
zip -d ${fileName} "docs*" || true &&
zip -d ${fileName} "phpcs.xml.dist" || true &&
zip -d ${fileName} "phpunit.xml.dist" || true &&
zip -d ${fileName} "tests*" || true &&
zip -d ${fileName} "examples*" || true
env:
fileName: google-api-php-client-${{ inputs.tag || steps.tagName.outputs.tag }}-PHP${{ matrix.php }}.zip
- name: Upload Release Archive
uses: softprops/action-gh-release@v2
if: github.ref_type == 'tag' || inputs.upload-on-workflow-dispatch == 'true'
with:
tag_name: ${{ inputs.tag || steps.tagName.outputs.tag }}
files: |
./google-api-php-client-${{ inputs.tag || steps.tagName.outputs.tag }}-PHP${{ matrix.php }}.zip