-
Notifications
You must be signed in to change notification settings - Fork 40
83 lines (70 loc) · 2.37 KB
/
release.yaml
File metadata and controls
83 lines (70 loc) · 2.37 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Release
on:
push:
tags:
- "v*"
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
release:
name: Prepare & Create Release
runs-on: ubuntu-latest
permissions:
contents: write # Create releases and upload assets
issues: write # Comment on related issues
pull-requests: write # Comment on related PRs
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 install
- 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: Determine prerelease status
id: prerelease
env:
REF: ${{ github.ref }}
run: |
if [[ "$REF" == *"-alpha"* ]] || [[ "$REF" == *"-beta"* ]]; then
echo "flag=--prerelease" >> $GITHUB_OUTPUT
else
echo "flag=" >> $GITHUB_OUTPUT
fi
- name: Create release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG_NAME: ${{ github.ref_name }}
CHANGELOG: ${{ steps.changelog.outputs.text }}
PRERELEASE_FLAG: ${{ steps.prerelease.outputs.flag }}
run: |
gh release create "$TAG_NAME" \
--title "$TAG_NAME" \
--notes "$CHANGELOG" \
$PRERELEASE_FLAG \
./dist.tar.gz
- name: Comment on related issues
uses: duncanmcclean/post-release-comments@ee2d062e73bd6f0898f36ed892953ed88134cc19 # v1.0.6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
version: ${{ github.ref }}
changelog: ${{ steps.changelog.outputs.text }}