mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-16 22:46:03 +01:00
feat(ci): version bumper
This commit is contained in:
10
.github/actions/bump-manifest-version.js
vendored
Normal file
10
.github/actions/bump-manifest-version.js
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
const fs = require('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)
|
||||||
27
.github/workflows/release.yml
vendored
27
.github/workflows/release.yml
vendored
@@ -3,7 +3,7 @@ name: Release
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- "v*"
|
- "v*.*.*"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
create-release:
|
create-release:
|
||||||
@@ -13,10 +13,12 @@ jobs:
|
|||||||
- 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/action-setup@v2.0.1
|
- uses: pnpm/action-setup@v2.0.1
|
||||||
with:
|
with:
|
||||||
version: 6.20.3
|
version: 6.20.3
|
||||||
@@ -41,6 +43,25 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
CI: false
|
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:
|
||||||
|
tag-name: ${{ github.ref_name }}
|
||||||
|
|
||||||
- name: Bundle files
|
- name: Bundle files
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ./temp/ox_lib
|
mkdir -p ./temp/ox_lib
|
||||||
|
|||||||
Reference in New Issue
Block a user