-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (57 loc) · 2.04 KB
/
Copy pathrelease.yml
File metadata and controls
65 lines (57 loc) · 2.04 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
name: "release"
on:
push:
tags: ["*"]
jobs:
lint:
runs-on: ubuntu-24.04
steps:
- name: Check out code 🛒
uses: actions/checkout@v6
- name: Setup PHP 🐫
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
- name: Linter 🧹
run: make lint
package:
runs-on: ubuntu-24.04
needs: [lint]
permissions:
contents: write
env:
BUILD_DIR: "build"
DIST_DIR_GITHUB: "dist/github"
GITHUB_RELEASE_FILENAME: "lantern.zip"
THEME_SLUG: "lantern"
steps:
- name: Check out code 🛒
uses: actions/checkout@v6
- name: Build theme zip 🔧
id: build-package
run: |
find ./lantern -type d -print0 | xargs -0 chmod 755
find ./lantern -name '*.php' -print0 | xargs -0 chmod 644
echo "${GITHUB_SHA}" > lantern/build.txt
make build # produces ${BUILD_DIR}/${THEME_SLUG}.zip
mkdir -p "${DIST_DIR_GITHUB}"
cp "${BUILD_DIR}/${THEME_SLUG}.zip" "${DIST_DIR_GITHUB}/${GITHUB_RELEASE_FILENAME}"
echo "ARTIFACT_PATH=${DIST_DIR_GITHUB}/${GITHUB_RELEASE_FILENAME}" >> $GITHUB_ENV
- name: Generate release notes 📝
if: github.ref_type == 'tag'
run: |
chmod +x ./.github/scripts/release-notes.sh
./.github/scripts/release-notes.sh "${GITHUB_REF_NAME}" CHANGELOG.md > release-notes.md
echo "----- release notes preview -----"
cat release-notes.md
RELEASE_TYPE=$(if [[ "${GITHUB_REF_NAME}" =~ beta|rc|alpha ]]; then echo "true"; else echo "false"; fi)
echo "RELEASE_TYPE=${RELEASE_TYPE}" >> $GITHUB_ENV
- name: Create GitHub release 🎉
if: github.ref_type == 'tag'
uses: ncipollo/release-action@v1
with:
artifacts: ${{ env.ARTIFACT_PATH }}
bodyFile: "release-notes.md"
prerelease: ${{ env.RELEASE_TYPE }}
generateReleaseNotes: false
allowUpdates: true