Skip to content

Commit a218244

Browse files
committed
ci(create-release): automatically bump fxmanifest version
1 parent 639224f commit a218244

File tree

2 files changed

+41
-9
lines changed

2 files changed

+41
-9
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const fxManifest = await Bun.file('./fxmanifest.lua').text();
2+
3+
let newVersion = process.env.TGT_RELEASE_VERSION;
4+
newVersion = newVersion.replace('v', '')
5+
6+
const newFileContent = fxManifest.replace(/\bversion\s+(.*)$/gm, `version '${newVersion}'`);
7+
8+
await Bun.write('./fxmanifest.lua', newFileContent);

.github/workflows/release.yml

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Create new release
1+
name: Create release
22

33
on:
44
workflow_dispatch:
@@ -7,19 +7,38 @@ on:
77
- 'v*.*.*'
88

99
jobs:
10-
release:
10+
create-release:
1111
runs-on: ubuntu-latest
1212
steps:
13+
- name: Install zip
14+
run: sudo apt install zip
15+
16+
- name: Install Bun
17+
uses: oven-sh/setup-bun@v2
18+
with:
19+
bun-version: latest
20+
21+
1322
- name: Get latest code
1423
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
ref: ${{ github.event.repository.default_branch }}
1527

16-
- name: Update tag
17-
uses: EndBug/latest-tag@v1
28+
29+
- name: Bump manifest version
30+
run: bun run .github/actions/bump-manifest-version.js
31+
env:
32+
TGT_RELEASE_VERSION: ${{ github.ref_name }}
33+
34+
- name: Push version bump change
35+
uses: EndBug/add-and-commit@v9
1836
with:
19-
ref: ${{ github.ref_name }}
37+
add: fxmanifest.lua
38+
push: true
39+
default_author: github_actions
40+
message: 'chore: bump version to ${{ github.ref_name }}'
2041

21-
- name: Install zip
22-
run: sudo apt install zip
2342

2443
- name: Bundle files
2544
run: |
@@ -29,8 +48,13 @@ jobs:
2948
cd ./temp && zip -r ../ac_radio.zip ./ac_radio
3049
3150
- name: Create release
32-
uses: softprops/action-gh-release@v2
51+
uses: 'marvinpinto/action-[email protected]'
3352
with:
34-
token: ${{ github.token }}
53+
repo_token: ${{ github.token }}
3554
prerelease: false
3655
files: ac_radio.zip
56+
57+
- name: Update tag
58+
uses: EndBug/latest-tag@v1
59+
with:
60+
ref: ${{ github.ref_name }}

0 commit comments

Comments
 (0)