-
Notifications
You must be signed in to change notification settings - Fork 7
59 lines (49 loc) · 1.71 KB
/
release.yml
File metadata and controls
59 lines (49 loc) · 1.71 KB
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
name: Release
on: # zizmor: ignore[concurrency-limits]
push:
tags:
- "v*"
permissions: {}
jobs:
release: # zizmor: ignore[anonymous-definition]
name: Prepare & Create Release
runs-on: ubuntu-latest
permissions:
contents: write # create GitHub release and upload assets
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup PHP
uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # v2
with:
php-version: 8.4
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
tools: composer:v2
- name: Install Composer Dependencies
run: composer install
- name: Install NPM Dependencies
run: npm ci
- name: Compile assets
run: npm run build
- name: Create zip
run: tar -czvf dist.tar.gz dist
- name: Get Changelog
id: changelog
uses: statamic/changelog-action@5d112d0d790cdeeb5adca3e584e37edc474ab51b # v1
with:
version: ${{ github.ref }}
- name: Create release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_VERSION: ${{ steps.changelog.outputs.version }}
RELEASE_NOTES: ${{ steps.changelog.outputs.text }}
run: |
PRERELEASE=""
if [[ "$RELEASE_VERSION" == *-beta* ]]; then PRERELEASE="--prerelease"; fi
gh release create "$RELEASE_VERSION" \
--title "$RELEASE_VERSION" \
--notes "$RELEASE_NOTES" \
$PRERELEASE \
./dist.tar.gz