generated from project-error/npwd-app-template
-
Notifications
You must be signed in to change notification settings - Fork 8
60 lines (51 loc) · 1.6 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
name: Build & Release
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
env:
APP_NAME: npwd_advertisements
APP_NICE_NAME: NPWD Advertisements
steps:
- name: Get tag
run: echo ::set-output name=VERSION_TAG::${GITHUB_REF/refs\/tags\//}
id: get_tag
- name: Checkout source code
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: 'yarn'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies & Build
run: yarn --frozen-lockfile && yarn build
- name: Build game scripts
run: yarn build:game
- name: Bundle
run: |
mkdir -p ./temp/${{env.APP_NAME}}
cp ./{README.md,fxmanifest.lua} ./temp/${{env.APP_NAME}}
cp -r ./dist ./temp/${{env.APP_NAME}}
cp -r ./web ./temp/${{env.APP_NAME}}
cd ./temp && zip -r ../${{env.APP_NAME}}.zip ./${{env.APP_NAME}}
- name: Create Release
uses: 'marvinpinto/[email protected]'
id: auto_release
with:
repo_token: '${{ secrets.GITHUB_TOKEN }}'
title: ${{env.APP_NICE_NAME}} | ${{ steps.get_tag.outputs.VERSION_TAG }}
prerelease: false
files: ${{env.APP_NAME}}.zip
env:
CI: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}