108 lines (88 loc) · 3.46 KB
/
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: "Release"
on:
push:
tags:
- "*"
env:
SOLIDINVOICE_ENV: prod
SOLIDINVOICE_DEBUG: 0
permissions: # added using https://github.com/step-security/secure-workflows
contents: read
jobs:
build:
permissions:
contents: write # for actions/create-release to create a release
name: Upload Release Asset
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
- uses: FranzDiebold/github-env-vars-action@5be1a823971b42aea2115f6d742484ab9a314bb6
- name: Checkout code
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
with:
path: solidinvoice
- name: Install PHP
uses: shivammathur/setup-php@8872c784b04a1420e81191df5d64fbd59d3d3033
with:
coverage: none
extensions: curl, gd, intl, opcache, json, openssl, pdo, soap, xsl, :xdebug
ini-values: memory_limit=-1
php-version: 8.1
- name: Install PHP dependencies
run: composer install --ansi --no-interaction --no-progress --no-suggest --prefer-dist --no-dev -o -a
working-directory: solidinvoice
- name: Set ENV Variables
run: |
echo SOLIDINVOICE_ENV=$SOLIDINVOICE_ENV > .env
echo SOLIDINVOICE_DEBUG=$SOLIDINVOICE_DEBUG >> .env
working-directory: solidinvoice
- name: Install JS dependencies
run: yarn install
working-directory: solidinvoice
- name: Build Assets
run: yarn build
working-directory: solidinvoice
- name: Cleanup files
run: rm -Rf node_modules vendor-bin .github .git
working-directory: solidinvoice
- name: Create release
id: create_release
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ env.CI_REF_NAME }}
draft: true
body: TODO
- name: Create ZIP distribution
run: zip -r SolidInvoice-${{ env.CI_REF_NAME }}.zip ./
- name: List files
run: ls -la
- name: Upload ZIP distribution
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./SolidInvoice-${{ env.CI_REF_NAME }}.zip
asset_name: SolidInvoice-${{ env.CI_REF_NAME }}.zip
asset_content_type: application/zip
- name: Delete ZIP File
run: rm -Rf SolidInvoice-${{ env.CI_REF_NAME }}.zip
- name: Create TAR distribution
run: tar -zcvf SolidInvoice-${{ env.CI_REF_NAME }}.tar.gz ./solidinvoice
- name: Upload TAR distribution
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./SolidInvoice-${{ env.CI_REF_NAME }}.tar.gz
asset_name: SolidInvoice-${{ env.CI_REF_NAME }}.tar.gz
asset_content_type: application/gzip
- name: Delete TAR File
run: rm -Rf SolidInvoice-${{ env.CI_REF_NAME }}.tar.gz