mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-03 14:38:50 +00:00
ci(release): version bumper
This commit is contained in:
1 parent
613570167c
commit
8ea5aad876
2 files changed
+43
-16
No files matched your search
@@ -1,10 +1,10 @@
|
|||||||
const fs = require('fs')
|
const fs = require('fs');
|
||||||
|
|
||||||
const version = process.env.TGT_RELEASE_VERSION
|
const version = process.env.TGT_RELEASE_VERSION;
|
||||||
const newVersion = version.replace('v', '')
|
const newVersion = version.replace('v', '');
|
||||||
|
|
||||||
const manifestFile = fs.readFileSync('fxmanifest.lua', {encoding: 'utf8'})
|
const manifestFile = fs.readFileSync('fxmanifest.lua', { encoding: 'utf8' });
|
||||||
|
|
||||||
const newFileContent = manifestFile.replace(/\bversion\s+(.*)$/gm, `version '${newVersion}'`)
|
const newFileContent = manifestFile.replace(/\bversion\s+(.*)$/gm, `version '${newVersion}'`);
|
||||||
|
|
||||||
fs.writeFileSync('fxmanifest.lua', newFileContent)
|
fs.writeFileSync('fxmanifest.lua', newFileContent);
|
||||||
@@ -1,34 +1,42 @@
|
|||||||
name: Release
|
name: Build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'v*.*.*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
create-release:
|
create-release:
|
||||||
name: Build and Create Tagged Release
|
name: Build and Create Tagged release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install archive tools
|
- name: Install archive tools
|
||||||
run: sudo apt install zip
|
run: sudo apt install zip
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
- name: Checkout source code
|
||||||
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
ref: ${{ github.ref }}
|
ref: ${{ github.event.repository.default_branch }}
|
||||||
- uses: pnpm/[email protected]
|
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/[email protected]
|
||||||
with:
|
with:
|
||||||
version: 6.20.3
|
version: 6.20.3
|
||||||
|
|
||||||
|
- name: Get variables
|
||||||
|
id: get_vars
|
||||||
|
run: |
|
||||||
|
echo '::set-output name=SHORT_SHA::$(git rev-parse --short HEAD)'
|
||||||
|
echo '::set-output name=DATE::$(date +'%D')'
|
||||||
|
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: 16.x
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
|
cache-dependency-path: 'pnpm-lock.yaml'
|
||||||
- name: Set env
|
|
||||||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm i
|
run: pnpm i
|
||||||
@@ -36,6 +44,25 @@ jobs:
|
|||||||
- name: Run build
|
- name: Run build
|
||||||
run: pnpm build
|
run: pnpm build
|
||||||
|
|
||||||
|
- 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:
|
||||||
|
tag-name: ${{ github.ref_name }}
|
||||||
|
|
||||||
- name: Bundle files
|
- name: Bundle files
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ./temp/oxmysql
|
mkdir -p ./temp/oxmysql
|
||||||
@@ -52,7 +79,7 @@ jobs:
|
|||||||
id: auto_release
|
id: auto_release
|
||||||
with:
|
with:
|
||||||
repo_token: '${{ secrets.GITHUB_TOKEN }}'
|
repo_token: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
title: ${{ env.RELEASE_VERSION }}
|
title: '${{ env.RELEASE_VERSION }}'
|
||||||
prerelease: false
|
prerelease: false
|
||||||
files: oxmysql.zip
|
files: oxmysql.zip
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user