Skip to content

Commit b45529b

Browse files
committed
Version
1 parent 10f6931 commit b45529b

5 files changed

Lines changed: 115 additions & 41 deletions

File tree

.github/workflows/bundle.yml

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
- 'bundle/darklua.config'
1010
- 'rokit.toml'
1111
- 'selene.toml'
12+
tags-ignore:
13+
- 'v*'
1214

1315
jobs:
1416
build:
@@ -50,43 +52,3 @@ jobs:
5052
with:
5153
name: repackage-${{ steps.slug.outputs.sha_short }}-${{ matrix.platform.name }}-${{ matrix.arch }}
5254
path: bundle/repackage*
53-
54-
release:
55-
needs: build
56-
runs-on: ubuntu-latest
57-
permissions:
58-
contents: write
59-
steps:
60-
- name: Checkout
61-
uses: actions/checkout@v3
62-
- name: Get short SHA
63-
id: slug
64-
run: echo "sha_short=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT
65-
66-
- name: Download artifacts
67-
uses: actions/download-artifact@v4
68-
with:
69-
path: artifacts
70-
71-
- name: Zip artifacts
72-
run: |
73-
cd artifacts
74-
for dir in */; do
75-
dirn="${dir%/}"
76-
cd "$dirn"
77-
zip "../../${dirn}.zip" *
78-
cd ..
79-
done
80-
cd ..
81-
ls -la *.zip
82-
83-
- name: Create Release
84-
uses: softprops/action-gh-release@v1
85-
with:
86-
name: Nightly - ${{ steps.slug.outputs.sha_short }}
87-
tag_name: nightly-${{ steps.slug.outputs.sha_short }}
88-
files: "*.zip"
89-
draft: false
90-
prerelease: false
91-
env:
92-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- 'v*'
6+
7+
jobs:
8+
build:
9+
strategy:
10+
matrix:
11+
platform:
12+
- {name: windows, os: windows-2022}
13+
- {name: linux, os: ubuntu-22.04}
14+
arch: [x86_64, aarch64]
15+
runs-on: ${{ matrix.platform.os }}
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
20+
- uses: CompeyDev/setup-rokit@v0.1.2
21+
with:
22+
version: v1.2.0
23+
cache: false
24+
token: ${{ github.token }}
25+
26+
- name: Bundle Files
27+
run: darklua process src/Repackage.luau bundle/Bundled.luau -c bundle/darklua.config
28+
29+
- name: Build (Windows)
30+
if: matrix.platform.name == 'windows'
31+
run: lune build bundle/Bundled.luau -o bundle/repackage.exe -t windows-${{ matrix.arch }}
32+
33+
- name: Build (Linux)
34+
if: matrix.platform.name == 'linux'
35+
run: lune build bundle/Bundled.luau -o bundle/repackage -t linux-${{ matrix.arch }}
36+
37+
- name: Upload Bundle Artifact
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: repackage-${{ github.ref_name }}-${{ matrix.platform.name }}-${{ matrix.arch }}
41+
path: bundle/repackage*
42+
43+
release:
44+
needs: build
45+
runs-on: ubuntu-latest
46+
permissions:
47+
contents: write
48+
steps:
49+
- name: Checkout
50+
uses: actions/checkout@v3
51+
52+
- name: Get Version
53+
id: version
54+
shell: bash
55+
run: |
56+
VERSION=$(bash scripts/get_version.sh)
57+
echo "version=$VERSION" >> $GITHUB_OUTPUT
58+
59+
- name: Download artifacts
60+
uses: actions/download-artifact@v4
61+
with:
62+
path: artifacts
63+
64+
- name: Zip artifacts
65+
run: |
66+
cd artifacts
67+
for dir in */; do
68+
dirn="${dir%/}"
69+
cd "$dirn"
70+
zip "../../${dirn}.zip" *
71+
cd ..
72+
done
73+
cd ..
74+
ls -la *.zip
75+
76+
- name: Create Release
77+
uses: softprops/action-gh-release@v1
78+
with:
79+
name: ${{ steps.version.outputs.version }}
80+
tag_name: ${{ github.ref_name }}
81+
files: "*.zip"
82+
draft: false
83+
prerelease: false
84+
env:
85+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ jobs:
1313
strategy:
1414
matrix:
1515
platform:
16-
- {name: windows, os: windows-2022}
1716
- {name: linux, os: ubuntu-22.04}
1817
arch: [x86_64, aarch64]
1918
runs-on: ${{ matrix.platform.os }}

scripts/get_version.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
## Path stuff
6+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7+
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
8+
9+
## Version
10+
VERSION=$(grep 'REPACKAGE_VERSION =' "$PROJECT_ROOT/src/Version.luau" | awk -F'"' '{print $2}')
11+
12+
echo $VERSION

src/Version.luau

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--!nonstrict
2+
--// Version
3+
--// Author: okzyrox
4+
--/ Date: 2026/02/20
5+
6+
local REPACKAGE_VERSION = "1.0.0"
7+
local REPACKAGE_VERSION_PARTS = {
8+
MAJOR = 1,
9+
MINOR = 0,
10+
PATCH = 0,
11+
}
12+
13+
return {
14+
Version = REPACKAGE_VERSION,
15+
VersionParts = REPACKAGE_VERSION_PARTS,
16+
}

0 commit comments

Comments
 (0)