forked from worksome/graphlint
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (52 loc) · 1.82 KB
/
draft-release.yml
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
# 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