feat(ci): version bumper

This commit is contained in:
Linden
2022-08-23 04:44:52 +10:00
parent 4578d54c5e
commit 6fc1efdda1
2 changed files with 34 additions and 3 deletions

View 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)

View File

@@ -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