Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates #10

Merged
merged 5 commits into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/actions/bump-manifest.js
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)
29 changes: 21 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,39 +28,52 @@ jobs:
with:
node-version: '21.x'
cache: 'pnpm'
cache-dependency-path: 'web/pnpm-lock.yaml'
cache-dependency-path: |
pnpm-lock.yaml
web/pnpm-lock.yaml

- name: Install script dependencies
run: pnpm install
working-directory: /

- name: Install web dependencies
run: pnpm install
working-directory: web

- name: Build Script
run: pnpm run build
working-directory: /

- 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,locales} ./temp/bl_appearance
cp -r ./build ./temp/bl_appearance/build/
cp -r ./dist ./temp/bl_appearance/dist/
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 }}
title: ${{ github.ref_name }}
prerelease: false
files: bl_appearance.zip
files: bl_appearance.zip
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
pnpm-lock.yaml
/build
/dist
1 change: 0 additions & 1 deletion build/Accessories.js

This file was deleted.

1 change: 0 additions & 1 deletion build/Clothes.js

This file was deleted.

1 change: 0 additions & 1 deletion build/ColourDropdown.js

This file was deleted.

1 change: 0 additions & 1 deletion build/Dropdown.js

This file was deleted.

1 change: 0 additions & 1 deletion build/Face.js

This file was deleted.

1 change: 0 additions & 1 deletion build/Hair.js

This file was deleted.

Loading
Loading