Merge pull request #5 from EcomDev/release-please--branches--main #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main | |
env: | |
PHAR_TOOL_VERSION: 1.4.0 | |
PHAR_TOOL_REPOSITORY: clue/phar-composer | |
permissions: | |
contents: write | |
pull-requests: write | |
name: Create Release | |
jobs: | |
verify-release: | |
uses: ./.github/workflows/php-package.yml | |
release-please: | |
needs: verify-release | |
runs-on: ubuntu-24.04 | |
outputs: | |
releases_created: ${{ steps.release.outputs.release_created }} | |
tag: ${{ steps.release.outputs.tag_name }} | |
steps: | |
- uses: googleapis/release-please-action@v4 | |
id: release | |
with: | |
release-type: php | |
upload_phar: | |
needs: release-please | |
runs-on: ubuntu-24.04 | |
if: ${{ needs.release-please.outputs.releases_created == true }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ needs.release-please.outputs.tag }} | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
tools: composer:v2 | |
- name: Download build package | |
run: gh release download v${{ env.PHAR_TOOL_VERSION }} -R=${{ env.PHAR_TOOL_REPOSITORY }} | |
- name: Build package | |
run: | | |
chmod +x ./phar-composer-${{ env.PHAR_TOOL_VERSION }}.phar | |
./phar-composer-${{ env.PHAR_TOOL_VERSION }}.phar build ./ mysql2json | |
env: | |
GH_TOKEN: ${{ github.token }} | |
- name: Upload package | |
run: gh release upload ${{ needs.release-please.outputs.tag }} mysql2json | |
env: | |
GH_TOKEN: ${{ github.token }} |