diff --git a/README.md b/README.md index 556d746..ed74a37 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/release/action.yml b/release/action.yml new file mode 100644 index 0000000..b17b7c5 --- /dev/null +++ b/release/action.yml @@ -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