Add release action

This commit is contained in:
Shivam Mathur
2024-03-13 17:11:44 +05:30
parent 19ae824802
commit ea302e470a
2 changed files with 38 additions and 6 deletions

View File

@@ -131,20 +131,21 @@ It will also check if a GitHub hosted Windows runner is available with the requi
## Release
Upload the artifacts to the release.
Upload the artifacts to a release.
```yaml
- name: Upload artifact to the release
uses: php/php-windows-builder/release@v1
with:
tag-name: ${{ github.event.release.tag_name }}
release: ${{ github.event.release.tag_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
### Inputs
- `tag-name` (required) - The tag name of the release.
- `release` (required) - The release to upload the artifacts.
- `token` (required) - The GitHub token to authenticate with.
### Example workflow to build and release an extension
@@ -188,9 +189,8 @@ jobs:
- name: Upload artifact to the release
uses: php/php-windows-builder/release@v1
with:
tag-name: ${{ github.event.release.tag_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release: ${{ github.event.release.tag_name }}
token: ${{ secrets.GITHUB_TOKEN }}
```
## License

32
release/action.yml Normal file
View File

@@ -0,0 +1,32 @@
name: release
description: Upload the artifacts to a release
author: php
branding:
icon: package
color: purple
inputs:
release:
description: 'Git reference for the release'
required: true
token:
description: 'GitHub token'
required: true
runs:
using: composite
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get artifacts
uses: actions/download-artifact@v4
with:
name: artifacts
- name: Upload artifacts
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.token }}
run: gh release upload ${{ inputs.release }} artifacts/* --clobber