Skip to content

Merge pull request #45 from worksome/feature/configuration-builder #95

Merge pull request #45 from worksome/feature/configuration-builder

Merge pull request #45 from worksome/feature/configuration-builder #95

Workflow file for this run

# Creates a draft release
name: Draft Release
on:
push:
branches:
- main
jobs:
releaseDraft:
name: Update draft
runs-on: ubuntu-latest
steps:
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v4
- name: Fetch version
id: version
run: |
VERSION="$(cat VERSION)"
echo "::set-output name=version::$VERSION"
# Remove old release drafts by using the curl request for the available releases with draft flag
- name: Remove Old Release Drafts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api repos/{owner}/{repo}/releases \
--jq '.[] | select(.draft == true) | .id' \
| xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
# Create new release draft - which is not publicly visible and requires manual acceptance
- name: Create Release Draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ steps.version.outputs.version }} \
--draft \
--title "${{ steps.version.outputs.version }}" \
--generate-notes
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
- name: Download Box Phar
run: wget https://github.com/box-project/box/releases/latest/download/box.phar && chmod 755 box.phar
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
with:
composer-options: "--no-dev"
- name: Compile Graphlint into Phar
run: ./box.phar compile
- name: Upload phar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ steps.version.outputs.version }} build/graphlint || true