Skip to content

Commit 3242b8f

Browse files
committed
Add build release job to github actions
1 parent d63cf0b commit 3242b8f

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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 -e APP_ENV=prod phpfpm composer install --no-dev --optimize-autoloader
28+
docker compose run --rm --user=root -e APP_ENV=prod phpfpm composer clear-cache
29+
30+
- name: Make assets dir
31+
run: |
32+
mkdir -p ../assets
33+
34+
- name: Create archive
35+
run: |
36+
sudo chown -R runner:runner ./
37+
tar --exclude='.git' -zcf ../assets/${{ github.event.repository.name }}-${{ github.ref_name }}.tar.gz ./
38+
39+
- name: Create checksum
40+
run: |
41+
cd ../assets
42+
sha256sum ${{ github.event.repository.name }}-${{ github.ref_name }}.tar.gz > ../assets/checksum.txt
43+
44+
- name: Create a release in GitHub and uploads assets
45+
run: gh release create ${{ github.ref_name }} --verify-tag --generate-notes ../assets/*.*
46+
env:
47+
GITHUB_TOKEN: ${{ github.TOKEN }}
48+
shell: bash

0 commit comments

Comments
 (0)