Skip to content

Commit 188d4a8

Browse files
committed
4184: Added github action to build release
1 parent 8ce9dc4 commit 188d4a8

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
on:
2+
push:
3+
tags:
4+
- '*.*.*'
5+
6+
name: Create Github Release
7+
8+
permissions:
9+
contents: write
10+
11+
env:
12+
COMPOSE_USER: runner
13+
14+
jobs:
15+
create-release:
16+
runs-on: ubuntu-latest
17+
env:
18+
COMPOSER_ALLOW_SUPERUSER: 1
19+
APP_ENV: prod
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Composer install
25+
run: |
26+
docker network create frontend
27+
docker compose run --rm --user=root phpfpm composer install --no-dev -o --classmap-authoritative
28+
docker compose run --rm --user=root phpfpm composer clear-cache
29+
30+
- name: Build theme
31+
run: |
32+
- docker compose run --rm node yarn install
33+
- docker compose run --rm node yarn build
34+
- docker compose run --rm node rm -rf node_modules
35+
# Ensure everything is owned by runner
36+
- sudo chown -R ${{ COMPOSE_USER }}:${{ COMPOSE_USER }} web
37+
38+
- name: Make assets dir
39+
run: |
40+
mkdir -p ../assets
41+
42+
- name: Create archive
43+
run: |
44+
sudo chown -R runner:runner ./
45+
tar --exclude='.git' -zcf ../assets/${{ github.event.repository.name }}-${{ github.ref_name }}.tar.gz ./
46+
47+
- name: Create checksum
48+
run: |
49+
cd ../assets
50+
sha256sum ${{ github.event.repository.name }}-${{ github.ref_name }}.tar.gz > ../assets/checksum.txt
51+
52+
- name: Create a release in GitHub and uploads assets
53+
run: gh release create ${{ github.ref_name }} --verify-tag --generate-notes ../assets/*.*
54+
env:
55+
GITHUB_TOKEN: ${{ github.TOKEN }}
56+
shell: bash

0 commit comments

Comments
 (0)