-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (51 loc) · 1.78 KB
/
build_release.yml
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
on:
push:
tags:
- '*.*.*'
name: Create Github Release
permissions:
contents: write
env:
COMPOSE_USER: runner
jobs:
create-release:
runs-on: ubuntu-latest
env:
COMPOSER_ALLOW_SUPERUSER: 1
APP_ENV: prod
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Composer install
run: |
docker network create frontend
docker compose run --rm --user=root phpfpm composer install --no-dev -o --classmap-authoritative
docker compose run --rm --user=root phpfpm composer clear-cache
- name: Building assets for the frontend
run: |
docker compose run --rm node yarn install
docker compose run --rm node yarn build
- name: Build assets for Giv Din Stemme module
run: |
docker compose run --rm node yarn --cwd web/modules/custom/giv_din_stemme/ install
docker compose run --rm node yarn --cwd web/modules/custom/giv_din_stemme/ build
- name: Clean up
run: |
sudo chown -R runner:runner ./
rm -rf node_modules
rm -rf web/modules/custom/giv_din_stemme/node_modules
- name: Make assets dir
run: |
mkdir -p ../assets
- name: Create archive
run: |
tar --exclude='.git' -zcf ../assets/${{ github.event.repository.name }}-${{ github.ref_name }}.tar.gz ./
- name: Create checksum
run: |
cd ../assets
sha256sum ${{ github.event.repository.name }}-${{ github.ref_name }}.tar.gz > ../assets/checksum.txt
- name: Create a release in GitHub and uploads assets
run: gh release create ${{ github.ref_name }} --verify-tag --generate-notes ../assets/*.*
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
shell: bash