-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (44 loc) · 1.11 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
name: Release
on:
push:
tags:
- "*"
permissions:
contents: write
jobs:
build-and-release:
runs-on: ubuntu-24.04
name: Build and release
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.3"
- name: Checkout repository
uses: actions/checkout@v4
- name: Install NPM dependencies
run: npm install
- name: Build assets
run: npm run build
- name: Clean release
run: |
rm -rf .git* node_modules
- name: Define release version
run: |
TAG=${{ github.ref_name }}
{
echo "TAG=$TAG"
echo "VERSION=${TAG#v}"
} >> "$GITHUB_ENV"
- name: Build release
run: |
DIRECTORY="mfa-$VERSION"
TARGET="/tmp/mfa-$VERSION.tar.gz"
cd ..
cp -R mfa "$DIRECTORY"
tar --owner 0 --group 0 -czf "$TARGET" "$DIRECTORY"
rm -rf "$DIRECTORY"
- name: Create release
uses: softprops/action-gh-release@v2
with:
files: /tmp/mfa-*.tar.gz