generated from Byte-Labs-Studio/bl_svelte_template
-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
991 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import fs from 'fs'; | ||
|
||
const version = process.env.TGT_RELEASE_VERSION | ||
const newVersion = version.replace('v', '') | ||
|
||
const manifestFile = fs.readFileSync('fxmanifest.lua', {encoding: 'utf8'}) | ||
|
||
const newFileContent = manifestFile.replace(/\bversion\s+(.*)$/gm, `version '${newVersion}'`) | ||
|
||
fs.writeFileSync('fxmanifest.lua', newFileContent) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: Lint | ||
on: [push, pull_request] | ||
jobs: | ||
lint: | ||
name: Lint Resource | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Lint | ||
uses: iLLeniumStudios/fivem-lua-lint-action@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: Build and Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' # This triggers the workflow on version tags | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Install archive tools | ||
run: sudo apt install zip | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.event.repository.default_branch }} | ||
|
||
- uses: pnpm/[email protected] | ||
with: | ||
version: 8.6.1 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '21.x' | ||
cache: 'pnpm' | ||
cache-dependency-path: | | ||
pnpm-lock.yaml | ||
web/pnpm-lock.yaml | ||
- name: Install script dependencies | ||
run: pnpm install | ||
|
||
- name: Install web dependencies | ||
run: pnpm install | ||
working-directory: web | ||
|
||
- name: Build Script | ||
run: pnpm run build | ||
|
||
- name: Build Svelte project | ||
run: pnpm run build | ||
working-directory: web | ||
|
||
- name: Bump manifest version | ||
run: node .github/actions/bump-manifest.js | ||
env: | ||
TGT_RELEASE_VERSION: ${{ github.ref_name }} | ||
|
||
- name: Push manifest change | ||
uses: EndBug/add-and-commit@v8 | ||
with: | ||
add: fxmanifest.lua | ||
push: true | ||
author_name: BL Development | ||
message: 'chore: bump manifest version to ${{ github.ref_name }}' | ||
|
||
- name: Bundle files | ||
run: | | ||
mkdir -p ./temp/bl_appearance | ||
mkdir -p ./temp/bl_appearance/dist/ | ||
mkdir -p ./temp/bl_appearance/build/ | ||
cp ./{LICENSE,README.md,fxmanifest.lua,appearance.sql,Installation.md} ./temp/bl_appearance | ||
cp -r ./{data,locale} ./temp/bl_appearance | ||
cp -r ./build/* ./temp/bl_appearance/build/ | ||
cp -r ./dist/* ./temp/bl_appearance/dist/ | ||
cd ./temp && zip -r ../bl_appearance.zip ./bl_appearance | ||
- name: Create Release | ||
uses: 'marvinpinto/action-automatic-releases@latest' | ||
with: | ||
repo_token: '${{ secrets.GITHUB_TOKEN }}' | ||
title: ${{ github.ref_name }} | ||
prerelease: false | ||
files: bl_appearance.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules | ||
pnpm-lock.yaml | ||
/build | ||
/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.