Skip to content
This repository was archived by the owner on Apr 29, 2025. It is now read-only.

Commit b8d2e16

Browse files
committed
feat(ci): Automatic fxmanifest bumping
1 parent 23bcf90 commit b8d2e16

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const fs = require('fs')
2+
3+
const version = process.env.TGT_RELEASE_VERSION
4+
const newVersion = version.replace('v', '')
5+
6+
const manifestFile = fs.readFileSync('fxmanifest.lua', {encoding: 'utf8'})
7+
8+
const newFileContent = manifestFile.replace(/\bversion\s+(.*)$/gm, `version '${newVersion}'`)
9+
10+
fs.writeFileSync('fxmanifest.lua', newFileContent)

.github/workflows/release.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ jobs:
99
create-release:
1010
name: Build and Create Tagged Release
1111
runs-on: ubuntu-latest
12-
1312
steps:
1413
- name: Install archive tools
1514
run: sudo apt install zip
@@ -62,3 +61,26 @@ jobs:
6261
env:
6362
CI: false
6463
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
bump-manifest-version:
65+
name: 'Bump fxmanifest version'
66+
needs: create-release
67+
runs-on: ubuntu-latest
68+
steps:
69+
- name: Get tag
70+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
71+
- name: Checkout
72+
uses: actions/checkout@v2
73+
with:
74+
ref: main
75+
- name: Bump manifest version
76+
run: node .github/actions/bump-manifest-version.js
77+
env:
78+
TGT_RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
79+
- name: Push manifest change
80+
uses: EndBug/add-and-commit@v8
81+
with:
82+
add: fxmanifest.lua
83+
push: true
84+
author_name: Manifest Bumper
85+
author_email: 41898282+github-actions[bot]@users.noreply.github.com
86+
message: 'chore(bump-manifest): Bump manifest version to ${{ env.RELEASE_VERSION }}'

0 commit comments

Comments
 (0)