mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-01 22:21:51 +00:00
87 lines
2.3 KiB
YAML
87 lines
2.3 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
create-release:
|
|
name: Build and Create Tagged Release
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Install archive tools
|
|
run: sudo apt install zip
|
|
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
ref: ${{ github.ref }}
|
|
- uses: pnpm/[email protected]
|
|
with:
|
|
version: 6.20.3
|
|
|
|
- name: Setup node
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: 16.x
|
|
cache: 'pnpm'
|
|
|
|
- name: Set env
|
|
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
|
|
|
- name: Install root dependencies
|
|
run: pnpm install
|
|
|
|
- name: Install ui dependencies
|
|
run: pnpm install
|
|
working-directory: ui
|
|
|
|
- name: Run build
|
|
run: pnpm build
|
|
|
|
- name: Bundle files
|
|
run: |
|
|
mkdir -p ./temp/oxmysql
|
|
mkdir -p ./temp/oxmysql/ui/
|
|
cp ./{LICENSE,README.md,fxmanifest.lua,ui.lua} ./temp/oxmysql
|
|
cp -r ./{lib,dist} ./temp/oxmysql
|
|
cp -r ./ui/build ./temp/oxmysql/ui/
|
|
cd ./temp && zip -r ../oxmysql.zip ./oxmysql
|
|
|
|
- name: Create Release
|
|
uses: 'marvinpinto/[email protected]'
|
|
id: auto_release
|
|
with:
|
|
repo_token: '${{ secrets.GITHUB_TOKEN }}'
|
|
title: ${{ env.RELEASE_VERSION }}
|
|
prerelease: false
|
|
files: oxmysql.zip
|
|
|
|
env:
|
|
CI: false
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
bump-manifest-version:
|
|
name: 'Bump fxmanifest version'
|
|
needs: create-release
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Get tag
|
|
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
ref: main
|
|
- name: Bump manifest version
|
|
run: node .github/actions/bump-manifest-version.js
|
|
env:
|
|
TGT_RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
|
|
- 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): Bump manifest version to ${{ env.RELEASE_VERSION }}'
|