diff --git a/.github/actions/bump-manifest-version.js b/.github/actions/bump-manifest-version.js new file mode 100644 index 0000000..c7895c7 --- /dev/null +++ b/.github/actions/bump-manifest-version.js @@ -0,0 +1,14 @@ +const fs = require('fs') + +const version = process.env.TGT_RELEASE_VERSION +const newVersion = version.replace('v', '') + +const manifestFile = fs.readFileSync('fxmanifest.lua', {encoding: 'utf8'}) + +let newFileContent = manifestFile.replace(/\bversion\s+(.*)$/gm, `version '${newVersion}'`) + +if (newFileContent == manifestFile) { + newFileContent = manifestFile.replace(/\bgame\s+(.*)$/gm, `game 'gta5'\nversion '${newVersion}'`); +} + +fs.writeFileSync('fxmanifest.lua', newFileContent) \ No newline at end of file diff --git a/.github/contributing.md b/.github/contributing.md index 5ff1b52..4e20ab2 100644 --- a/.github/contributing.md +++ b/.github/contributing.md @@ -104,7 +104,7 @@ Before creating enhancement suggestions, please check [this list](#before-submit * **Make sure it doesn't already exist.** Sounds silly, but there's a lot of features built in to Qbox that people don't realize so take a look through the docs and stuff to make sure it's not already there. * **Check if there's already PR which provides that enhancement.** -* **Determine which resource the enhancement should be suggested in.** Whichever resource the suggestion is about, is where it should go. If the suggestion is about Qbox as a whole, make the suggestion in the qbx_core repository. +* **Determine which resource the enhancement should be suggested in.** Whichever resource the suggestion is about, is where it should go. If the suggestion is about Qbox as a whole, make the suggestion in the qbx-core repository. * **Perform a [cursory search](https://github.com/search?q=is%3Aissue+user%3Aqbox-project++&type=issues&state=open)** to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. #### How Do I Submit A (Good) Enhancement Suggestion? diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b2bb456 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,54 @@ +name: Create New Release + +on: + workflow_dispatch: + inputs: + version: + required: true + +jobs: + create-release: + name: Create New Release + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4.1.1 + with: + fetch-depth: 0 + ref: ${{ github.event.repository.default_branch }} + + - name: Setup node + uses: actions/setup-node@v2 + with: + node-version: 16.x + + - name: Bump manifest version + run: node .github/actions/bump-manifest-version.js + env: + TGT_RELEASE_VERSION: ${{ inputs.version }} + + - name: Push manifest change + uses: EndBug/add-and-commit@latest + 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 ${{ inputs.version }}' + + - name: Install ZIP + run: sudo apt install zip + + - name: Bundle files + run: | + rm -rf ./.github ./.vscode ./.git + zip -r ./${{ github.event.repository.name }}.zip ./ + + - name: Create Release + uses: 'marvinpinto/action-automatic-releases@latest' + with: + title: ${{ inputs.version }} + repo_token: '${{ secrets.GITHUB_TOKEN }}' + automatic_release_tag: ${{ inputs.version }} + prerelease: false + files: ${{ github.event.repository.name }}.zip \ No newline at end of file