Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
ErrorRExorY committed Feb 15, 2024
1 parent 4c0f91e commit 876f663
Showing 1 changed file with 37 additions and 56 deletions.
93 changes: 37 additions & 56 deletions .github/workflows/build-prod.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: Release Workflow

on:
push:
Expand All @@ -9,79 +9,60 @@ jobs:
create-release:
name: Build and Create Tagged Release
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Install archive tools
run: sudo apt install zip

- name: Checkout source code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.repository.default_branch }}

- name: Setup pnpm
uses: pnpm/action-setup@v2
- name: Setup node
uses: actions/setup-node@v3
with:
version: 8.15.1
node-version: 20
cache: 'npm'
cache-dependency-path: web/package-lock.json

- name: Install dependencies
run: cd web && pnpm i

# - name: Bump package version
# run: npm version ${{ github.ref_name }}
# working-directory: web
run: |
if [ -d "web" ]; then
npm i
working-directory: web
fi
- name: Run build
run: pnpm run build
working-directory: web
run: |
if [ -d "web" ]; then
npm run build
working-directory: web
fi
env:
CI: false

# - name: Bump manifest version
# run: node .github/actions/bump-manifest-version.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: Manifest Bumper
# author_email: 41898282+github-actions[bot]@users.noreply.github.com
# message: 'chore: bump manifest version to ${{ github.ref_name }}'

- name: Update tag ref
uses: EndBug/latest-tag@latest
with:
ref: ${{ github.ref_name }}

- name: Create exclude file from input
run: |
echo "node_modules" >> exclude.txt
echo ".git" >> exclude.txt
echo ".github" >> exclude.txt
echo "exclude.txt" >> exclude.txt
echo "temp/" >> exclude.txt
- name: Bundle files
run: |
ls
mkdir -p ./temp/esx_hud
mkdir -p ./temp/esx_hud/web/
cp ./{LICENSE,README.md,fxmanifest.lua,config.lua,sv_config.lua} ./temp/esx_hud
cp -r ./{client,server,shared} ./temp/esx_hud
cp -r ./web/dist ./temp/esx_hud/web/
cd ./temp && zip -r ../esx_hud.zip ./esx_hud
mkdir -p ./temp/release
rsync -av --progress --exclude-from=exclude.txt ./ ./temp/release/
if [ -d "web/dist" ]; then
mkdir -p ./temp/release/web
cp -r ./web/dist ./temp/release/web/dist
fi
cd ./temp && zip -r ../release.zip ./release
- name: Create Release
uses: 'marvinpinto/[email protected]'
id: auto_release
with:
repo_token: '${{ secrets.GITHUB_TOKEN }}'
title: ${{ env.RELEASE_VERSION }}
automatic_release_tag: ${{ github.ref_name }}
prerelease: false
files: esx_hud.zip

env:
CI: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Publish npm package
# uses: JS-DevTools/npm-publish@v1
# with:
# token: ${{ secrets.NPM_TOKEN }}
# package: './package/package.json'
# access: 'public'
files: release.zip

0 comments on commit 876f663

Please sign in to comment.